[CI][RFC] Replace black-jupyter with ruff-format (#37210)
Co-authored-by: Alison Shao <a.shao@wustl.edu>
This commit is contained in:
co-authored by
Alison Shao
parent
2641e427be
commit
28262c20df
@@ -46,9 +46,9 @@ def native_per_token_group_quant_fp8(
|
||||
quantized tensor along with the scaling factor used for quantization.
|
||||
Note that only `torch.float8_e4m3fn` is supported for now.
|
||||
"""
|
||||
assert (
|
||||
x.shape[-1] % group_size == 0
|
||||
), "the last dimension of `x` cannot be divisible by `group_size`"
|
||||
assert x.shape[-1] % group_size == 0, (
|
||||
"the last dimension of `x` cannot be divisible by `group_size`"
|
||||
)
|
||||
assert x.is_contiguous(), "`x` is not contiguous"
|
||||
|
||||
finfo = torch.finfo(dtype)
|
||||
@@ -343,7 +343,6 @@ def native_w8a8_block_fp8_matmul(A, B, As, Bs, block_size, output_dtype=torch.fl
|
||||
|
||||
|
||||
class TestW8A8BlockFP8Matmul(CustomTestCase):
|
||||
|
||||
if not _is_cuda:
|
||||
OUT_DTYPES = [torch.float32, torch.half, torch.bfloat16]
|
||||
M = [1, 7, 83, 512, 2048]
|
||||
|
||||
@@ -171,7 +171,6 @@ def block_quant_dequant(
|
||||
|
||||
|
||||
class TestDeepGemmBlackwell(CustomTestCase):
|
||||
|
||||
if not _is_cuda:
|
||||
OUT_DTYPES = [torch.float32, torch.half, torch.bfloat16]
|
||||
M = [1, 7, 83, 512, 2048]
|
||||
|
||||
@@ -67,7 +67,7 @@ class TestDeepseekV32FP4DP(CustomTestCase):
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_gsm8k (deepseek-v3-fp4)\n" f'{metrics["score"]=:.3f}\n'
|
||||
f'### test_gsm8k (deepseek-v3-fp4)\n{metrics["score"]=:.3f}\n'
|
||||
)
|
||||
|
||||
self.assertGreater(metrics["score"], 0.93)
|
||||
@@ -135,7 +135,7 @@ class TestDeepseekV32FP4TP(CustomTestCase):
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_gsm8k (deepseek-v3-fp4)\n" f'{metrics["score"]=:.3f}\n'
|
||||
f'### test_gsm8k (deepseek-v3-fp4)\n{metrics["score"]=:.3f}\n'
|
||||
)
|
||||
|
||||
self.assertGreater(metrics["score"], 0.93)
|
||||
|
||||
@@ -70,7 +70,7 @@ class TestDeepseekV3FP4(CustomTestCase):
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_gsm8k (deepseek-v3-fp4)\n" f'{metrics["score"]=:.3f}\n'
|
||||
f'### test_gsm8k (deepseek-v3-fp4)\n{metrics["score"]=:.3f}\n'
|
||||
)
|
||||
|
||||
self.assertGreater(metrics["score"], 0.93)
|
||||
@@ -83,7 +83,7 @@ class TestDeepseekV3FP4(CustomTestCase):
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_bs_1_speed (deepseek-v3-fp4)\n" f"{speed=:.2f} token/s\n"
|
||||
f"### test_bs_1_speed (deepseek-v3-fp4)\n{speed=:.2f} token/s\n"
|
||||
)
|
||||
|
||||
self.assertGreater(speed, 120)
|
||||
|
||||
@@ -46,7 +46,6 @@ class TestEvalFP8Accuracy(CustomTestCase):
|
||||
|
||||
|
||||
class TestEvalFP8DynamicQuantAccuracy(CustomTestCase):
|
||||
|
||||
def _run_test(self, model, other_args, expected_score):
|
||||
base_url = DEFAULT_URL_FOR_TEST
|
||||
other_args = other_args or []
|
||||
|
||||
Reference in New Issue
Block a user