Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.11', '3.12', '3.13']
transformers: ['4.48.3', '4.51.3', '4.52.4', '4.55.4', '4.56.2', '4.57.3', 'main']
transformers: ['4.48.3', '4.51.3', '4.52.4', '4.55.4', '4.56.2', '4.57.6', 'main']
torch: ['2.9', 'main']
exclude:
- python: '3.10' # 3.10
Expand All @@ -33,7 +33,7 @@ jobs:
- python: '3.10'
transformers: '4.56.2'
- python: '3.10'
transformers: '4.57.3'
transformers: '4.57.6'
- python: '3.11' # 3.11
torch: 'main'
- python: '3.11'
Expand All @@ -43,7 +43,7 @@ jobs:
- python: '3.11'
transformers: '4.56.2'
- python: '3.11'
transformers: '4.57.3'
transformers: '4.57.6'
- python: '3.13' # 3.11
torch: '2.9'
- python: '3.13'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python: ['3.12']
transformers: ['4.57.3']
transformers: ['4.57.6']
torch: ['main']
steps:
- uses: actions/checkout@v3
Expand Down
27 changes: 14 additions & 13 deletions onnx_diagnostic/torch_export_patches/patches/patch_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,16 @@ def compute_concrete_val() -> sympy.Basic:

transmute_into_runtime_assert = False

backed_var_to_val = getattr(
self, "backed_var_to_val", getattr(self, "var_to_val", {})
)
concrete_val = None
if not (expr.free_symbols <= self.var_to_val.keys()):
if not (expr.free_symbols <= backed_var_to_val.keys()):
# TODO: dedupe this with _maybe_evaluate_static
# Attempt to eliminate the unbacked SymInt
new_expr = self._maybe_evaluate_static(expr, unbacked_only=True)
assert new_expr is not None
if not (new_expr.free_symbols <= self.var_to_val.keys()):
if not (new_expr.free_symbols <= backed_var_to_val.keys()):
ok = False

# fallback_value is set when guard_or_true or guard_or_false are used.
Expand All @@ -541,17 +544,15 @@ def compute_concrete_val() -> sympy.Basic:
# oblivious_var_to_val will be defined iff we have sizes
# with DimDynamic.OBLIVIOUS_SIZE type.
# See https://github.com/pytorch/pytorch/issues/137100#issuecomment-2495778113
var_to_val = getattr(
self,
"unbacked_var_to_val",
getattr(self, "oblivious_var_to_val", False),
)
if (
var_to_val
and not (correct_hint := orig_expr.xreplace(var_to_val)).free_symbols
backed_var_to_val
and getattr(self, "real_tensor_prop_unbacked_vals", True)
and not (
correct_hint := orig_expr.xreplace(backed_var_to_val)
).free_symbols
and not (
counterfactual_hint := orig_expr.xreplace(
{k: max(2, v) for k, v in var_to_val.items()}
{k: max(2, v) for k, v in backed_var_to_val.items()}
)
).free_symbols
and correct_hint == counterfactual_hint
Expand All @@ -574,10 +575,10 @@ def compute_concrete_val() -> sympy.Basic:
# and if they pass we add a runtime assertions and continue.
if (
not ok
and var_to_val
and backed_var_to_val
and not (
unsound_result := orig_expr.xreplace(var_to_val).xreplace(
var_to_val
unsound_result := orig_expr.xreplace(backed_var_to_val).xreplace(
backed_var_to_val
)
).free_symbols
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def _ccached_microsoft_phi2():
"transformers_version": "4.51.0.dev0",
"use_cache": true,
"vocab_size": 51200,
"pad_token_id": 0,
}
)

Expand Down
1 change: 1 addition & 0 deletions onnx_diagnostic/torch_models/untrained/llm_phi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def get_phi2(
"transformers_version": "4.37.0",
"use_cache": True,
"vocab_size": 51200,
"pad_token_id": 0,
}
config.update(**kwargs)
conf = transformers.PhiConfig(**config)
Expand Down
Loading