intel / torch-xpu-ops

Apache License 2.0
30 stars 21 forks source link

Embedding_bag_out does not have boundary check and causes IPEX UT fail #1052

Closed LuFinch closed 1 week ago

LuFinch commented 2 weeks ago

🐛 Describe the bug

Background: IPEX added boundary check assertion in gpu kernel https://github.com/intel-innersource/frameworks.ai.pytorch.ipex-gpu/pull/4555 and a UT(ipex/tests/gpu/example/test_embedding_bag.py::TestTorchMethod::test_embeddingbag_out_of_bounds) to test the debug log being printed when input is out of boundary.

Ops in torch-xpu-ops do not have this check and hence fail in this UT.

I check that CUDA does not have this boundary check, this feature is IPEX only. In IPEX2.5, we override this Ops with IPEX implementation to make this UT pass.

Please decide whether we need to add this boundary check in torch-xpu-ops.

Versions

ipex/tests/gpu/example/test_embedding_bag.py::TestTorchMethod::test_embeddingbag_out_of_bounds

Assertion vec_idx < num_row failed

chunhuanMeng commented 1 week ago

pr merged, suggest to close this issue.