Skip to content

Add --compare-backed-unbacked flag for benchmarking dynamic shapes#175946

Closed
laithsakka wants to merge 11 commits intogh/laithsakka/411/basefrom
gh/laithsakka/411/head
Closed

Add --compare-backed-unbacked flag for benchmarking dynamic shapes#175946
laithsakka wants to merge 11 commits intogh/laithsakka/411/basefrom
gh/laithsakka/411/head

Conversation

@laithsakka
Copy link
Contributor

@laithsakka laithsakka commented Feb 27, 2026

Stack from ghstack (oldest at bottom):

[lsakka@devgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py --backend inductor --performance --inference --compare-backed-unbacked

--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @Lucaskabela

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 27, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/175946

Note: Links to docs will display an error until the docs builds have been completed.

⏳ 1 Pending, 2 Unrelated Failures

As of commit 1d71ef5 with merge base 07efc60 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
@laithsakka laithsakka requested review from EikanWang, jansel and sladyn98 and removed request for jansel February 28, 2026 03:22
@laithsakka laithsakka marked this pull request as ready for review February 28, 2026 03:23
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx kadeng chauhang amjames Lucaskabela jataylo

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo Lucaskabela

[ghstack-poisoned]
laithsakka added a commit that referenced this pull request Mar 3, 2026
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo Lucaskabela

[ghstack-poisoned]
…c shapes"



[lsakkadevgpu009.cco5 ~/pytorch10/pytorch (13694ac)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked 

```
--- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

--- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

--- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

--- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

--- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo Lucaskabela

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #175956

pytorchmergebot pushed a commit that referenced this pull request Mar 5, 2026
…on to avoid DDE (#175956)

encountered while running
python benchmarks/dynamo/huggingface.py --only AllenaiLongformerBase --backend inductor --performance --inference --unbacked-batch-only

Pull Request resolved: #175956
Approved by: https://github.com/ColinPeppler, https://github.com/jansel
ghstack dependencies: #175946
meta-codesync bot pushed a commit to pytorch/benchmark that referenced this pull request Mar 6, 2026
…175946)

Summary:
[lsakka@devgpu009.cco5 ~/pytorch10/pytorch (13694ac6)]$ python benchmarks/dynamo/huggingface.py  --backend inductor --performance --inference --compare-backed-unbacked

```
 --- AlbertForMaskedLM ---
  backed... 1.349x
  unbacked... 1.345x
  => diff: -0.3%

 --- AllenaiLongformerBase ---
  backed... 1.226x
  unbacked... 1.146x
  => diff: -6.5%

 --- BartForCausalLM ---
  backed... 1.022x
  unbacked... 1.015x
  => diff: -0.7%

 --- BertForMaskedLM ---
  backed... 1.186x
  unbacked... 1.187x
  => diff: +0.1%

 --- BlenderbotForCausalLM ---
  backed... 1.058x
  unbacked... 1.061x
  => diff: +0.3%
...
```

X-link: pytorch/pytorch#175946
Approved by: https://github.com/jansel

Reviewed By: wdvr

Differential Revision: D95429517

fbshipit-source-id: 73b36865b88feb3718ac3e41e6843a7b60ca7a85
pytorchmergebot pushed a commit that referenced this pull request Mar 10, 2026
Adds min and max parameters to mark_unbacked() to allow specifying
value range constraints for unbacked dimensions.

When an unbacked symbol is created with min/max bounds, torch._check()
calls are emitted to establish the constraints (e.g., torch._check(u0 >= 1)).

Pull Request resolved: #176313
Approved by: https://github.com/Lucaskabela, https://github.com/mlazos
ghstack dependencies: #175946, #175956
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants