onnxruntime
b5fb2b89 - [Annotations] Address cuda orginal matching (#28623)

Commit
112 days ago
[Annotations] Address cuda orginal matching (#28623) This pull request improves the accuracy and safety of device matching logic for GPU execution providers, especially when using numeric GPU indices (e.g., `gpu:1`) in layering rules. The changes ensure that matching by index only occurs when a runtime device ordinal is available (from `device_memory_info`), preventing accidental matches with hardware PCI device IDs. The update also enhances logging and expands test coverage for these scenarios. **Device matching logic improvements:** * Added a `has_device_ordinal` flag to `EpDeviceView` and updated matching logic so that index-based GPU matching only occurs when the device ordinal is known to be a runtime ordinal (from `device_memory_info`), not a hardware PCI ID. [[1]](diffhunk://#diff-a8f614056d63b5b3325eea1d855afc96550c977c16d8fdba641012a79194b7b5R169) [[2]](diffhunk://#diff-a8f614056d63b5b3325eea1d855afc96550c977c16d8fdba641012a79194b7b5L193-R198) [[3]](diffhunk://#diff-a8f614056d63b5b3325eea1d855afc96550c977c16d8fdba641012a79194b7b5L288-R299) [[4]](diffhunk://#diff-a8f614056d63b5b3325eea1d855afc96550c977c16d8fdba641012a79194b7b5R324) * Updated log messages to provide clearer error information when a layering rule with a numeric GPU index cannot be mapped, including guidance for troubleshooting. **Test improvements:** * Updated and expanded unit tests to cover correct and incorrect GPU index matching, including cases where only hardware IDs are present and should not match, and added a new test for execution providers with specific GPU ordinals. [[1]](diffhunk://#diff-37d64a2aa66018cc6a40ca2227432eae6c33dd6c1456d19ef539e869ee9d4f72L364-R366) [[2]](diffhunk://#diff-37d64a2aa66018cc6a40ca2227432eae6c33dd6c1456d19ef539e869ee9d4f72L375-R387) [[3]](diffhunk://#diff-37d64a2aa66018cc6a40ca2227432eae6c33dd6c1456d19ef539e869ee9d4f72R566-R584)
Author
Parents
Loading