Fix #4150: [Bug] TestWeightStrippedEngine OOM on RTX 3070 (8GB) with ...#4155
Fix #4150: [Bug] TestWeightStrippedEngine OOM on RTX 3070 (8GB) with ...#4155JiwaniZakir wants to merge 1 commit intopytorch:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @JiwaniZakir! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Reducing to batch size 2 fixes the OOM but it's worth verifying the tests still meaningfully exercise the weight-stripping logic — specifically that the refitting path in |
Closes #4150
Description
Reduces batch sizes in three
TestWeightStrippedEnginetests intests/py/dynamo/models/test_weight_stripped_engine.pyto prevent CUDA out-of-memory failures on GPUs with 8GB VRAM (e.g., RTX 3070).The three affected tests were using batch size 100 or 128 for ResNet-18 inputs at shape
(N, 3, 224, 224), which exhausts available VRAM on 8GB cards under CUDA 12.x. The fix reduces all example and inference inputs to batch size 2:test_weight_stripped_engine_sizes:example_inputsreduced from(100, 3, 224, 224)to(2, 3, 224, 224)test_weight_stripped_engine_results:example_inputsreduced from(100, 3, 224, 224)to(2, 3, 224, 224); inferenceinputsreduced from(128, 3, 224, 224)to(2, 3, 224, 224)test_two_TRTRuntime_in_refitting: same reductions astest_weight_stripped_engine_resultsThe dynamic shape bounds (
min=1, max=200) are unchanged, so these tests continue to exercise dynamic batching. The correctness assertions intest_weight_stripped_engine_resultsand the engine size comparisons intest_weight_stripped_engine_sizesremain intact.Fixes # (issue)
Type of change
Checklist: