pytorch
ca180539 - inductor: add fake mode tracing for cumsum graph pattern (#102820)

Commit
2 years ago
inductor: add fake mode tracing for cumsum graph pattern (#102820) When running dynamic shape of ```OPTForCausalLM``` path, there has an error: ```TypeError: unsupported operand type(s) for +: 'Node' and 'int'```, this PR will do: 1. For ```pointless_cumsum_replacement```, the sizes may be a node, we should trace the target pattern using example input. 2. For dynamic shape, we should trace a pattern under fake mode in which inputs may have symbolic inputs. After this PR, the dynamic shape of ```OPTForCausalLM``` can work(```python -m torch.backends.xeon.run_cpu --node_id 0 benchmarks/dynamo/huggingface.py --performance --float32 -dcpu --inference -n5 --inductor --dynamic-shapes --only OPTForCausalLM```). Pull Request resolved: https://github.com/pytorch/pytorch/pull/102820 Approved by: https://github.com/jgong5, https://github.com/desertfire, https://github.com/jansel
Author
Committer
Parents
Loading