已合并
fix_config_copy #36444
fix_config_copy #36444
已合并
Ambi创建于 5月22日
2 个文件变更+3-1
Mtest/_inductor/test_run_and_save_rng_state.py+1-1
@@ -28,7 +28,7 @@ class TestRunAndSaveRngState(TestUtils):
28 28 
29 return rng_state1, res1, rng_state2, res229 return rng_state1, res1, rng_state2, res2
30 30 
31- @parametrize("shape", [(10,)])31+ @parametrize("shape", [(20,)])
32 @parametrize("dtype", [torch.float32])32 @parametrize("dtype", [torch.float32])
33 def test_rng_state_with_compile(self, shape, dtype):33 def test_rng_state_with_compile(self, shape, dtype):
34 device = "npu"34 device = "npu"
Mtorch_npu/utils/_dynamo.py+2-0
@@ -174,6 +174,8 @@ def patch_inductor_wrapper():
174 174 
175 def new_get_config_copy(self) -> dict[str, Any]:175 def new_get_config_copy(self) -> dict[str, Any]:
176 ori_dict = src_get_config_copy(self)176 ori_dict = src_get_config_copy(self)
177+ if self is not torch._inductor.config:
178+ return ori_dict
177 if "npu_backend" not in ori_dict:179 if "npu_backend" not in ori_dict:
178 ori_dict["npu_backend"] = "default"180 ori_dict["npu_backend"] = "default"
179 cfg = Config(default="default", value_type=str)181 cfg = Config(default="default", value_type=str)