-
Notifications
You must be signed in to change notification settings - Fork 272
tests: skip _assert_params_superset when upstream forward is (*args, **kwargs) #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,6 +170,18 @@ def _assert_params_superset( | |
| ): | ||
| got = _param_names(func) | ||
| missing = [name for name in required if name not in got] | ||
| if missing and _has_var_keyword(func): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling |
||
| # Newer transformers wrap many upstream forwards as | ||
| # ``(self, *args, **kwargs)`` (attention-impl dispatch, generic | ||
| # decorators, etc.). The zoo patch's call site stays valid because | ||
| # kwargs flow through verbatim; static param-name verification is | ||
| # not meaningful for a wrapped signature. Skip rather than emit | ||
| # spurious DRIFT. | ||
| pytest.skip( | ||
| f"{label} is wrapped as `(self, *args, **kwargs)` on " | ||
| f"transformers {_TX_VERSION}; static param-name verification " | ||
| "is not meaningful for this passthrough signature." | ||
| ) | ||
|
Comment on lines
+173
to
+184
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The generalization of this skip logic in |
||
| if missing: | ||
| try: | ||
| sig = inspect.signature(func) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This treats any signature with a
**kwargscatch-all as an opaque passthrough, but several callers verified by this helper still rely on explicit positional parameters. For example,test_gemma4_text_decoder_layer_init_signaturerequireslayer_idx, and the patch calls_original_decoder_init(self, config, layer_idx)positionally; if upstream changed to__init__(self, config, **kwargs), this new branch would skip the drift test even though that call would raise from the extra positional argument. Please restrict the skip to true generic wrappers such as(self, *args, **kwargs)or keep positional call sites strict.Useful? React with 👍 / 👎.