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
4 changes: 4 additions & 0 deletions onnx_diagnostic/ci_models/export_qwen25_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ def main(
).eval()
data = dict(model=model)
config = model.config
if not hasattr(config, "bos_token_id") or not config.bos_token_id:
config.bos_token_id = 151643
if not hasattr(config, "eos_token_id") or not config.eos_token_id:
config.eos_token_id = 151645
else:
print("-- random model")
data = get_untrained_model(model_id, second_input=second_input, verbose=1)
Expand Down
4 changes: 1 addition & 3 deletions onnx_diagnostic/helpers/log_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,9 +1921,7 @@ def first_err(df: pandas.DataFrame) -> pandas.Series:
return lambdas[formula]

if formula == "onnx_n_nodes_no_cst":
return lambda df: gdf(df, "onnx_n_nodes", 0) - gdf(
df, "op_onnx__Constant", 0
).fillna(0)
return lambda df: gdf(df, "onnx_n_nodes", 0) - gdf(df, "op_onnx__Constant", 0)
if formula == "peak_gpu_torch":
return lambda df: gdf(df, "mema_gpu_5_after_export") - gdf(df, "mema_gpu_4_reset")
if formula == "peak_gpu_nvidia":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,21 @@ def qwen_sdpa_attention(
return attn_output

def qwen_version_selector(opset: int, *args: torch.Tensor) -> Tuple[str, torch.dtype]:
import onnx_ir

first_float_tensor = next(
a
for a in args
if a is not None and a.dtype in {torch.float16, torch.float32, torch.bfloat16}
if a is not None
and a.dtype
in {
torch.float16,
torch.float32,
torch.bfloat16,
onnx_ir.DataType.BFLOAT16,
onnx_ir.DataType.FLOAT16,
onnx_ir.DataType.FLOAT,
}
)
dtype = first_float_tensor.dtype
strategy = patched_Qwen2_5_VLVisionAttention.STRATEGY_FOR_ATTENTION()
Expand Down
Loading