fix: make auto_docstring import-time performance test robust to timing noise. - #48149
Open
deepresearcher08 wants to merge 3 commits into
Open
Conversation
Contributor
|
Thank you for your contribution 🤗! CI Security Gate — automatic approval blockedThis PR was not automatically approved for CI because the security gate failed. Possible reasons:
See the workflow run for the exact violations. A maintainer can review and manually approve CI if a finding is a false positive. |
deepresearcher08
force-pushed
the
fix/flaky-auto-docstring-import-time-test
branch
from
August 21, 2026 11:51
dc7277a to
2c2daec
Compare
deepresearcher08
force-pushed
the
fix/flaky-auto-docstring-import-time-test
branch
from
August 21, 2026 12:39
2c2daec to
46b8b2c
Compare
Contributor
CI recapDashboard: View test results in Grafana |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
-
tests/utils/test_auto_docstring.pytime.perf_counter()totime.process_time()to prevent inflation of measurement from the co-tenant scheduling noise.min()over 10 iterations instead ofmedian()over 5, the minimum is the sample least contaminated by unrelated system activity.statisticsimport.For validation, I ran the test 8x locally (Python 3.11, torch CPU, pytest): per-module auto_docstring cost measured 5.3-6.7 ms against the 100 ms budget, giving ~15-20x headroom with a spread under 1.5 ms (vs the old ratio's ~15-point spread). Full test files collect cleanly (9 tests).
Fixes #48145
Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. These often are low-quality, or fix extremely minor issues that occur rarely or never in practice.
As a result, we're instituting a rule that first-time contributors should not use code agents to submit PRs or issues.
We'd also ask autonomous "OpenClaw"-like agents not to open any PRs or issues.
Issues/PRs from first-time contributors that violate this rule will probably just be closed without review, and we
might block you, especially if you open more than one or appear to be deliberately ignoring this. We especially do not
want new contributors to jump in on random issues to contribute an agent-written fix. This creates lots of noise
for reviewers and other users and will almost certainly get you blocked.
For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request checks?
to it if that's the case. Link to issue
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.