Skip to content

Commit 20e0146

Browse files
committed
Fix: set InfiniCore device explicitly before running test cases
Ensure the test framework explicitly sets the active InfiniCore device to match the selected test device before running test cases.
1 parent f91e4d3 commit 20e0146

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/infinicore/framework/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def run_tests(self, devices, test_func, test_type="Test"):
8080
print(f"Testing {test_type} on {InfiniDeviceNames[device]}")
8181
print(f"{'='*60}")
8282

83+
# Keep InfiniCore's runtime aligned with the selected test device.
84+
infinicore.set_device(infinicore.device(torch_device_map[device], 0))
85+
8386
for test_case in self.test_cases:
8487
try:
8588
print(f"{test_case}")

0 commit comments

Comments
 (0)