File tree 1 file changed +4
-0
lines changed
test/3x/torch/quantization/fp8_quant
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
def test_two_step_layer_wise ():
13
13
# layer-wise is based on memory mapping technique and https://github.com/huggingface/transformers/pull/31771
14
+ # Workaround of [SW-208658]: Memory mapping is blocked unreasonably
15
+ tmp_deterministic_algorithms_flag = torch .are_deterministic_algorithms_enabled ()
16
+ torch .use_deterministic_algorithms (False )
14
17
model_name = "facebook/opt-350m"
15
18
config = AutoConfig .from_pretrained (model_name )
16
19
# requires transformers >= 4.43.0, torch_dtype=config.torch_dtype
@@ -37,3 +40,4 @@ def test_two_step_layer_wise():
37
40
cpu_mem2 = get_used_cpu_mem_MB ()
38
41
model = convert (new_model , qconfig )
39
42
assert (cpu_mem2 - cpu_mem0 ) < 100 , "model with memory mapping should use no more than 100MiB."
43
+ torch .use_deterministic_algorithms (tmp_deterministic_algorithms_flag )
You can’t perform that action at this time.
0 commit comments