Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/e2e/long/test_qwen2.5_0.5B_gsm8k.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import os

import torch
from tests.ci.ci_register import register_cuda_ci

import miles.utils.external_utils.command_utils as U

register_cuda_ci(est_time=6000, suite="stage-c-2-gpu-h200", labels=["long"])
IS_ROCM = torch.version.hip is not None

MODEL_NAME = "Qwen2.5-0.5B-Instruct"
MODEL_TYPE = "qwen2.5-0.5B"
Expand Down Expand Up @@ -81,7 +83,10 @@ def execute():
ci_args = (
"--ci-test "
"--ci-disable-kl-checker "
"--ci-metric-checker-key eval/gsm8k "
# ROCm (gfx950): the unfused bf16 wgrad path (needed to avoid a
# hipBLASLt BGRADB catalog gap) has ~1e-9 numerical drift.
+ ("--ci-disable-logprobs-checker " if IS_ROCM else "")
+ "--ci-metric-checker-key eval/gsm8k "
Comment on lines +88 to +89

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Mixing implicit string literal concatenation with explicit + operators inside parenthesized expressions is fragile and can easily lead to syntax errors or unexpected formatting during future modifications. Since Python supports implicit concatenation of f-strings, you can use an f-string ternary expression to keep the entire block as a single, cleanly concatenated string literal sequence.

Suggested change
+ ("--ci-disable-logprobs-checker " if IS_ROCM else "")
+ "--ci-metric-checker-key eval/gsm8k "
f"{'--ci-disable-logprobs-checker ' if IS_ROCM else ''}"
"--ci-metric-checker-key eval/gsm8k "

"--ci-metric-checker-threshold 0.55 " # loose threshold at 250 step
)

Expand All @@ -91,7 +96,8 @@ def execute():
"--hidden-dropout 0.0 "
# should be good for model performance
"--accumulate-allreduce-grads-in-fp32 "
"--attention-softmax-in-fp32 "
+ ("--no-gradient-accumulation-fusion " if IS_ROCM else "")
+ "--attention-softmax-in-fp32 "
Comment on lines +99 to +100

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similarly, using an f-string ternary expression here avoids mixing implicit and explicit string concatenation, keeping the parenthesized string clean and robust against future changes.

Suggested change
+ ("--no-gradient-accumulation-fusion " if IS_ROCM else "")
+ "--attention-softmax-in-fp32 "
f"{'--no-gradient-accumulation-fusion ' if IS_ROCM else ''}"
"--attention-softmax-in-fp32 "

# need to comment this when using model with MLA
"--attention-backend flash "
"--actor-num-nodes 1 "
Expand Down