Comments (2)
I wasn't able to repro this, but you could try doing this:
import torch.export._trace
ep = torch.export._trace._export(
model,
(input_ids,),
dynamic_shapes=({1: seq_len},),
strict=False,
_allow_complex_guards_as_runtime_asserts=True,
)
The _allow_complex_guards_as_runtime_asserts
flag should also allow you to export w/o needing torch.nn.attention.sdpa_kernel([SDPBackend.MATH])
from pytorch.
I wasn't able to repro this
Is this using the reproducer provided or using the code snippet you suggested ?
Btw, the code snippet you provided seems to work fine but is it recommended to use torch.export._trace._export
as a part of official examples ?
from pytorch.
Related Issues (20)
- RuntimeError: free_upper_bound + pytorch_used_bytes[device]
- Very large memory increase when combining bfloat16 autocast with torch.compile HOT 8
- How to Manage CPU Memory Usage in PyTorch After Moving Model to CPU? HOT 1
- Compiled tensor subclass can fail when graph break happens in the wrong place HOT 3
- Axioms sometimes fail to apply to discharge GuardOnDataDependent error HOT 1
- Exporting ResNet-50 with dynamic batch dimension results in violated constraints HOT 2
- PythonMod vs Mod spookiness
- type hints mismatch method comment in torch.distributed.fsdp._exec_order_utils.py HOT 1
- Host & Device Sync In LR Scheduler
- [PixelShuffle] PixelShuffle doesn't support channels_last feature for 5D inputs
- set_default_device corrupts the torch function mode stack HOT 1
- Scaled_dot_product_attention CPU flash_attention backend backward result is not the same as math backend HOT 10
- FlexAttention Gives Different Output Shapes With/Without Compilation HOT 9
- [torch.jit] RuntimeError: false INTERNAL ASSERT FAILED at "../torch/csrc/jit/ir/node_hashing.cpp":148, please report a bug to PyTorch.
- Can pytorch add sparse linear solvers like scipy.sparse.linalg.gmres, scipy.sparse.linalg.bicg etc. HOT 9
- wrong answer when torch.pow using negative powers HOT 1
- [torch.jit.trace] error encountered when tracing model with weight clamping during forward
- The doc of `Tanh()` says there are `*args` and `**kwargs` but they don't work
- The doc of `Softsign()` says there are `*args` and `**kwargs` but they don't work
- The doc of `Sigmoid()` says there are `*args` and `**kwargs` but they don't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.