Skip to content

fix: use getattr for sglang_speculative_algorithm to avoid AttributeError#1913

Open
none0663 wants to merge 1 commit into
THUDM:mainfrom
none0663:fix/sglang-speculative-algorithm-attr-error
Open

fix: use getattr for sglang_speculative_algorithm to avoid AttributeError#1913
none0663 wants to merge 1 commit into
THUDM:mainfrom
none0663:fix/sglang-speculative-algorithm-attr-error

Conversation

@none0663
Copy link
Copy Markdown
Contributor

@none0663 none0663 commented May 15, 2026

When sglang args are not parsed (e.g. debug_train_only mode), the args namespace does not have the sglang_speculative_algorithm attribute, causing an AttributeError in _compute_spec_metrics. Using getattr with a default of None safely handles both cases.
Clipboard_Screenshot_1778838539

…rror

When sglang args are not parsed (e.g. debug_train_only mode), the args
namespace does not have the sglang_speculative_algorithm attribute,
causing an AttributeError in _compute_spec_metrics. Using getattr with
a default of None safely handles both cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant