Nanmur opened a new pull request, #20323:
URL: https://github.com/apache/tvm/pull/20323

   The Relax ONNX importer used `str.strip("onnx::")` when 
`keep_params_in_input=True`. Since `strip` treats its argument as a set of 
characters, initializer names that do not have the prefix can still lose 
leading or trailing `o`, `n`, `x`, or `:` characters. For example, `neck...` 
became `eck...`.
   
   This change uses `str.removeprefix("onnx::")` so only the exact 
PyTorch-generated prefix is removed. The regression test covers both a prefixed 
initializer and an ordinary initializer beginning with `n`.
   
   Fixes #20290
   
   Tests:
   - `python -m pytest tests/python/relax/test_frontend_onnx.py -k 
'params_names_start_with_onnx or initializer_name_only_removes_onnx_prefix or 
concat_with_param or multi_ops_with_same_params' -q`
   - `python -m ruff check python/tvm/relax/frontend/onnx/onnx_frontend.py 
tests/python/relax/test_frontend_onnx.py`
   - `python -m ruff format --check 
python/tvm/relax/frontend/onnx/onnx_frontend.py 
tests/python/relax/test_frontend_onnx.py`
   
   Local full-file note: the complete ONNX test file reached 28 passing tests 
before hitting the unrelated Windows JIT export assertion `Target triple should 
not be empty`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to