Skip to content

Reduce HF calls during pytest execution#1249

Merged
jlarson4 merged 11 commits intodev-3.x-canaryfrom
bug/excessive-HF-API-calls-during-testing
Apr 13, 2026
Merged

Reduce HF calls during pytest execution#1249
jlarson4 merged 11 commits intodev-3.x-canaryfrom
bug/excessive-HF-API-calls-during-testing

Conversation

@jlarson4
Copy link
Copy Markdown
Collaborator

Description

The current TransformerBridge test suite runs hundreds of HF API calls. This PR is an effort to reduce the # of calls per-CI run, hopefully speeding up our overall CI feedback loop for v3.

The main focus of this PR is to scope model loading to a per-session operation, rather than a per test, so we don't have a multitude of tests reloading the same models. For operations that require modification of the model in place, I am deepcopying the original request model, and then making modifications to the copy. Any other operations run on the session model directly.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not rewritten tests relating to key interfaces which would affect backward compatibility

@jlarson4 jlarson4 merged commit 815b3c7 into dev-3.x-canary Apr 13, 2026
21 checks passed
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