File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -624,8 +624,14 @@ def forward(
624
624
torch.Tensor: Logits output from the model.
625
625
"""
626
626
self .stats .on_model_execution_start ()
627
- logging .debug (f"{ self .model .method_meta ('forward' )} " )
628
- logits = self .model .forward ((input_ids , cache_position ))[0 ]
627
+
628
+ try :
629
+ logits = self .model .forward ((input_ids , cache_position ))[0 ]
630
+ except Exception as e :
631
+ shapes = {name : val .shape for name , val in locals ().items () if hasattr (val , "shape" )}
632
+ print (f"Exception: { e } .\n { self .model .method_meta ('forward' )} \n arg shapes: { shapes } " )
633
+ raise
634
+
629
635
self .stats .on_model_execution_end ()
630
636
return logits
631
637
Original file line number Diff line number Diff line change 20
20
21
21
import pytest
22
22
import torchao
23
+ from executorch import version as executorch_version
23
24
from executorch .extension .pybindings .portable_lib import ExecuTorchModule
24
25
from packaging .version import parse
25
26
from transformers import AutoConfig , AutoTokenizer
@@ -76,8 +77,8 @@ def test_phi4_text_generation(self):
76
77
@slow
77
78
@pytest .mark .run_slow
78
79
@pytest .mark .skipif (
79
- parse (torchao .__version__ ) < parse ("0.11.0.dev0 " ),
80
- reason = "Only available on torchao >= 0.11.0.dev0 " ,
80
+ parse (executorch_version .__version__ ) > parse ("0.6.0 " ),
81
+ reason = "Require cache_position support in executorch runtime. Re-enable when available. " ,
81
82
)
82
83
def test_phi4_text_generation_with_quantized_pte_from_hub (self ):
83
84
model_id = "pytorch/Phi-4-mini-instruct-8da4w"
You can’t perform that action at this time.
0 commit comments