File tree Expand file tree Collapse file tree 1 file changed +0
-7
lines changed Expand file tree Collapse file tree 1 file changed +0
-7
lines changed Original file line number Diff line number Diff line change @@ -67,24 +67,17 @@ def test_mesh_conversion(self):
67
67
68
68
def test_spec_caching (self ):
69
69
"""Test that _spec property caches results
70
-
71
- Addresses PR comment: "These sorts of tests that rely on the wall clock often lead to
72
- annoying flakes in my experience. I think it's sufficient to just test that
73
- self._cached_spec has a permanent value after the first call."
74
70
"""
75
71
device_count = xr .global_runtime_device_count ()
76
72
mesh = DeviceMesh ("xla" , list (range (device_count )))
77
73
tensor = torch .randn (100 , 100 )
78
74
xla_tensor = distribute_tensor (tensor , mesh , [Shard (0 )])
79
75
80
- # First access should create and cache the spec
81
76
spec1 = xla_tensor ._spec
82
77
83
- # Verify the spec is cached
84
78
assert xla_tensor ._cached_spec is not None
85
79
assert xla_tensor ._cached_spec is spec1
86
80
87
- # Second access should return the cached spec
88
81
spec2 = xla_tensor ._spec
89
82
assert spec1 is spec2
90
83
You can’t perform that action at this time.
0 commit comments