Comments (5)
I debugged this some more:
- Python's warnings.warn has a cache (
globals()['__warningregistry__']
). It will only warn once as long as the warning was in the cache. - The cache can be invalidated (you can see this in
print(globals()['__warningregistry__'])
: the cache has a version number). It can be invalidated if any new filters are added, or if someone calls warnings.catch_warnings() - Dynamo adds a new filter here and FakeTensor calls catch_warnings() here. These are for "hiding warnings"
Taking a step back: what should the behavior of the above script actually be? Should we expect torch.compile'd code to reproduce warnings faithfully, or is it fine if there are a lot more warnings than expected?
IMO we should reproduce the warnings faithfully (warning spam is bad UX), but this means that we need to "hide warnings" in a different way.
from pytorch.
pytorch/torch/_dynamo/eval_frame.py
Lines 1629 to 1631 in adb6991
This one is kind of funny -- if you use Dynamo, then we will never show you distributed warnings again, even in eager-mode :P
from pytorch.
I think we should reproduce the warnings faithfully. Pages and pages of spam could lead to bad UX.
from pytorch.
Haha ... I might have added that long time ago when I had lil understanding of what's really going on. We can remove these, some of the dynamo wrapped tests might fail.
from pytorch.
I'm attracted to beefed up warning handler context manager that restores the cache when done
from pytorch.
Related Issues (20)
- vmap fails to call torch.compiled function HOT 2
- Add Swiglu activation function HOT 1
- Add RMS Norm layer HOT 2
- [Profiler][inductor] put kwinputs in chrome traces
- partitioner doesn't appear to respect SAC region
- Missing support for deterministic algorithm for torch.float8_e4m3fn and torch.float8_e5m2 HOT 3
- Flaky test page should include retry runs
- _foreach_vector_norm HOT 2
- Unable to assign `nn.Parameter(DTensor)` (created outside of compile region) to an nn.Module param attribute during Dynamo tracing HOT 3
- DSD for TorchTune LoRA
- Outdated ncclResult code HOT 2
- ONNX export for gelu at version 20
- Link https://pytorch.org/docs/stable/nn.html#torch.nn.EmbeddingBag may not exist anymore HOT 1
- torch 2.5.0.dev failing with tons of IMA issues
- False INTERNAL ASSERT FAILED bug whilst training Neural Network HOT 1
- The name of the function `nn.L1Loss()` should be `nn.MAE()` or the name of the function `MSELoss()` should be `nn.L2Loss()`
- Any plans for a "torch.minmax" (min-max normalization) function? HOT 1
- Assign `torch.Generator` in APIs like `torch.randn_like()`
- CUDA error in torch.cdist with compute_mode=donot_use_mm_for_euclid_dist HOT 1
- GradType: a subset of dtype that is differentiable, containing all float and complex dtypes HOT 2
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.