已合并
fix_registrations #37965
cuiduo创建于 6月9日
fix_registrations #37965
已合并
cuiduo创建于 6月9日
2 个文件变更+0-24
@@ -1,8 +1,6 @@
1import torch1import torch
2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests
3from testutils import TestUtils3from testutils import TestUtils
4-import torch_npu
5- 
6 4 
7class TestAdd(TestUtils):5class TestAdd(TestUtils):
8 def op_calc(self, first_element, second_element):6 def op_calc(self, first_element, second_element):
@@ -289,27 +289,6 @@ def patch_dynamo_optimize():
289 torch._dynamo.optimize = npu_optimize289 torch._dynamo.optimize = npu_optimize
290 290 
291 291 
292-def patch_base_schedulernode():
293- from torch._inductor.scheduler import BaseSchedulerNode, ExternKernelSchedulerNode
294- 
295- original_get_read_write_buffer_accesses = (
296- BaseSchedulerNode.get_read_write_buffer_accesses
297- )
298- 
299- def new_get_read_write_buffer_accesses(
300- self_instance, include_reads: bool, include_writes: bool
301- ) -> dict[str, int]:
302- if isinstance(self_instance, ExternKernelSchedulerNode):
303- return {}
304- return original_get_read_write_buffer_accesses(
305- self_instance, include_reads, include_writes
306- )
307- 
308- BaseSchedulerNode.get_read_write_buffer_accesses = (
309- new_get_read_write_buffer_accesses
310- )
311- 
312- 
313def patch_user_defined_class_variable():292def patch_user_defined_class_variable():
314 import functools293 import functools
315 294 
@@ -413,7 +392,6 @@ def add_dynamo_methods():
413 TensorVariable.call_method = TensorVariable_call_method392 TensorVariable.call_method = TensorVariable_call_method
414 patch_dynamo_optimize()393 patch_dynamo_optimize()
415 patch_inductor_wrapper()394 patch_inductor_wrapper()
416- patch_base_schedulernode()
417 patch_user_defined_class_variable()395 patch_user_defined_class_variable()
418 patch_record_stream()396 patch_record_stream()
419 patch_event_variable_python_type()397 patch_event_variable_python_type()