已合并
fix_config_copy #36442
Ambi创建于 5月22日
fix_config_copy #36442
已合并
从已删除 :v2.10.0合入到Ascend/pytorchv2.10.0
共 2 个文件变更+3-1
| @@ -28,7 +28,7 @@ class TestRunAndSaveRngState(TestUtils): | |||
| 28 | 28 | ||
| 29 | return rng_state1, res1, rng_state2, res2 | 29 | return rng_state1, res1, rng_state2, res2 |
| 30 | 30 | ||
| 31 | - @parametrize("shape", [(10,)]) | 31 | + @parametrize("shape", [(20,)]) |
| 32 | 32 | ||
| 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" |
| @@ -170,6 +170,8 @@ def patch_inductor_wrapper(): | |||
| 170 | 170 | ||
| 171 | def new_get_config_copy(self) -> dict[str, Any]: | 171 | def new_get_config_copy(self) -> dict[str, Any]: |
| 172 | ori_dict = src_get_config_copy(self) | 172 | ori_dict = src_get_config_copy(self) |
| 173 | + if self is not torch._inductor.config: | ||
| 174 | + return ori_dict | ||
| 173 | NpuBackendType = Literal["default", "mlir", "dvm"] | 175 | NpuBackendType = Literal["default", "mlir", "dvm"] |
| 174 | if "npu_backend" not in ori_dict: | 176 | if "npu_backend" not in ori_dict: |
| 175 | ori_dict["npu_backend"] = "default" | 177 | ori_dict["npu_backend"] = "default" |