mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Temporarily disable sparse tensor validation when loading from external storage. (#154758)
As in the title per https://github.com/pytorch/pytorch/issues/153143#issuecomment-2917793067 . The plan is to workout a solution that will allow (1) disabling pinned memory check to fix the original issue and (2) switching off the sparse tensor validation for maximal performance in loading sparse tensors. Pull Request resolved: https://github.com/pytorch/pytorch/pull/154758 Approved by: https://github.com/amjames, https://github.com/ngimel
This commit is contained in:
committed by
PyTorch MergeBot
parent
c99e91b1d7
commit
6a781619bf
@ -1,4 +1,4 @@
|
||||
add_loop_eager,compile_time_instruction_count,2953000000,0.015
|
||||
add_loop_eager,compile_time_instruction_count,2937000000,0.015
|
||||
|
||||
|
||||
|
||||
@ -18,15 +18,15 @@ add_loop_inductor_gpu,compile_time_instruction_count,25900000000,0.015
|
||||
|
||||
|
||||
|
||||
basic_modules_ListOfLinears_eager,compile_time_instruction_count,939900000,0.015
|
||||
basic_modules_ListOfLinears_eager,compile_time_instruction_count,952700000,0.015
|
||||
|
||||
|
||||
|
||||
basic_modules_ListOfLinears_inductor,compile_time_instruction_count,18270000000,0.015
|
||||
basic_modules_ListOfLinears_inductor,compile_time_instruction_count,18390000000,0.015
|
||||
|
||||
|
||||
|
||||
basic_modules_ListOfLinears_inductor_gpu_force_shape_pad,compile_time_instruction_count,16310000000,0.015
|
||||
basic_modules_ListOfLinears_inductor_gpu_force_shape_pad,compile_time_instruction_count,16450000000,0.015
|
||||
|
||||
|
||||
|
||||
@ -34,11 +34,11 @@ basic_modules_ListOfLinears_inductor_gpu,compile_time_instruction_count,10370000
|
||||
|
||||
|
||||
|
||||
update_hint_regression,compile_time_instruction_count,1700000000,0.02
|
||||
update_hint_regression,compile_time_instruction_count,1661000000,0.02
|
||||
|
||||
|
||||
|
||||
float_args,compile_time_instruction_count,452500000,0.015
|
||||
float_args,compile_time_instruction_count,455500000,0.015
|
||||
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ aotdispatcher_inference_subclass_cpu,compile_time_instruction_count,6022000000,0
|
||||
|
||||
|
||||
|
||||
aotdispatcher_partitioner_cpu,compile_time_instruction_count,8672000000,0.015
|
||||
aotdispatcher_partitioner_cpu,compile_time_instruction_count,8724000000,0.015
|
||||
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ aotdispatcher_partitioner_cpu2,compile_time_instruction_count,1917000000,0.015
|
||||
|
||||
|
||||
|
||||
aotdispatcher_training_nosubclass_cpu,compile_time_instruction_count,3859000000,0.015
|
||||
aotdispatcher_training_nosubclass_cpu,compile_time_instruction_count,3838000000,0.015
|
||||
|
||||
|
||||
|
||||
|
|
@ -413,6 +413,7 @@ class SerializationMixin:
|
||||
def test_serialization_sparse_safe(self):
|
||||
self._test_serialization(True)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_invalid(self):
|
||||
x = torch.zeros(3, 3)
|
||||
x[1][1] = 1
|
||||
@ -443,6 +444,7 @@ class SerializationMixin:
|
||||
"size is inconsistent with indices"):
|
||||
y = torch.load(f, weights_only=weights_only)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_invalid_legacy_ctor(self):
|
||||
# This is set in test class setup but would not be check when running user code
|
||||
prev_invariant_check_enabled = torch.sparse.check_sparse_tensor_invariants.is_enabled()
|
||||
@ -515,18 +517,22 @@ class SerializationMixin:
|
||||
f"`{compressed_indices_name}[[]..., 0[]] == 0` is not satisfied."):
|
||||
y = torch.load(f)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_csr_invalid(self):
|
||||
self._test_serialization_sparse_compressed_invalid(
|
||||
torch.Tensor.to_sparse_csr, torch.Tensor.crow_indices, torch.Tensor.col_indices)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_csc_invalid(self):
|
||||
self._test_serialization_sparse_compressed_invalid(
|
||||
torch.Tensor.to_sparse_csc, torch.Tensor.ccol_indices, torch.Tensor.row_indices)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_bsr_invalid(self):
|
||||
self._test_serialization_sparse_compressed_invalid(
|
||||
lambda x: x.to_sparse_bsr((1, 1)), torch.Tensor.crow_indices, torch.Tensor.col_indices)
|
||||
|
||||
@unittest.skipIf(True, "Temporary skip due to gh-153143")
|
||||
def test_serialization_sparse_bsc_invalid(self):
|
||||
self._test_serialization_sparse_compressed_invalid(
|
||||
lambda x: x.to_sparse_bsc((1, 1)), torch.Tensor.ccol_indices, torch.Tensor.row_indices)
|
||||
|
@ -276,7 +276,11 @@ _sparse_tensors_to_validate: list["torch.Tensor"] = []
|
||||
def _validate_loaded_sparse_tensors():
|
||||
try:
|
||||
for t in _sparse_tensors_to_validate:
|
||||
if t.layout is torch.sparse_coo:
|
||||
if True:
|
||||
# Temporarily disable sparse tensor validation due to
|
||||
# gh-153143.
|
||||
pass
|
||||
elif t.layout is torch.sparse_coo:
|
||||
torch._validate_sparse_coo_tensor_args(
|
||||
t._indices(), t._values(), t.size(), t.is_coalesced()
|
||||
)
|
||||
|
Reference in New Issue
Block a user