[ROCm][CI] Fix flaky GPTQ compile correctness test (#38161)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
@@ -137,6 +137,7 @@ def test_compile_correctness(
|
|||||||
all_args.append(
|
all_args.append(
|
||||||
final_args + [f"-cc.mode={mode.name}", "-cc.backend=inductor"]
|
final_args + [f"-cc.mode={mode.name}", "-cc.backend=inductor"]
|
||||||
)
|
)
|
||||||
|
all_envs.append({})
|
||||||
|
|
||||||
# inductor will change the output, so we only compare if the output
|
# inductor will change the output, so we only compare if the output
|
||||||
# is close, not exactly the same.
|
# is close, not exactly the same.
|
||||||
@@ -157,6 +158,5 @@ def test_compile_correctness(
|
|||||||
]:
|
]:
|
||||||
all_args.append(final_args + [f"-cc.mode={mode.name}", "-cc.backend=eager"])
|
all_args.append(final_args + [f"-cc.mode={mode.name}", "-cc.backend=eager"])
|
||||||
all_envs.append({})
|
all_envs.append({})
|
||||||
all_envs.append({})
|
|
||||||
|
|
||||||
compare_all_settings(model, all_args * 3, all_envs, method=method)
|
compare_all_settings(model, all_args, all_envs, method=method)
|
||||||
|
|||||||
@@ -1348,7 +1348,14 @@ def initialize_single_dummy_weight(
|
|||||||
high: float = 1e-3,
|
high: float = 1e-3,
|
||||||
seed: int = 1234,
|
seed: int = 1234,
|
||||||
) -> None:
|
) -> None:
|
||||||
if torch.is_floating_point(param):
|
if not torch.is_floating_point(param):
|
||||||
|
if current_platform.is_rocm():
|
||||||
|
# On ROCm, integer params (e.g. GPTQ qweight/qzeros) are left
|
||||||
|
# as torch.empty() by default, giving non-deterministic values
|
||||||
|
# across processes. Zero them for reproducibility.
|
||||||
|
param.zero_()
|
||||||
|
return
|
||||||
|
|
||||||
if current_platform.is_tpu():
|
if current_platform.is_tpu():
|
||||||
generator = torch.Generator(device="cpu")
|
generator = torch.Generator(device="cpu")
|
||||||
generator.manual_seed(seed)
|
generator.manual_seed(seed)
|
||||||
|
|||||||
Reference in New Issue
Block a user