Comments (2)
Another alternative option which doesn't involve nvFuser magically having the context on what is RoPE and what is the best group of ops to send to another executor -
User defined backend as a decorator.
In litGPT for example, if we have a pytorch function that does RoPE, we change the function to something like
@thunder.jit(force_backend=torch_compile_executor)
def apply_rope(inputs):
........
so when thunder is constructing the trace, any operations traced inside this function are pushed to the forced executor backend.
Pros:
- User gets control over execution
- Solves pattern matching for at least semi-ninja users. users can do this for anything and use custom kernels registered as backends in Thunder.
- Alleviates our RoPE perf issues
Cons:
- Adds complexity to user behavior and usage.
- Might force changes into how traces are constructed and transforms are done.
from lightning-thunder.
triage review —
- it would be good to talk through the issue and possible solutions during a technical discussion
- @kiya00 is gathering some additional benchmarking data that may inform our thinking here
- https://github.com/Lightning-AI/lightning-thunder/blob/main/notebooks/zero_to_thunder.ipynb has an extensibility section that may inform the rope mapping to execution (and how to divert it)
from lightning-thunder.
Related Issues (20)
- apex - fused_rms_norm is broken HOT 5
- Distributed notebook is failing in Ci HOT 1
- Add support for random ops in OpInfo
- enable using python_callable without mapping symbols to their impls HOT 1
- don't silently drop symbols without implementation
- Memory leak when raising an exception in jitted fn and catching it outside
- Prologue trace orders arguments in a way that breaks aliasing relation HOT 2
- PR #1110 nearly doubles the compilation & execution time of a copy-heavy program HOT 8
- HF LLaVa support HOT 4
- Thunder seems to use way more memory when `litgpt.Config.parallel_residual=True` HOT 5
- FSDP2 & Thunder looks memory hungrier than `thunder.distributed.fsdp` for certain models HOT 2
- `test_auto_register_torchops.py::TestFallbackToTorch::test_alexnet` is failing HOT 3
- improve shape accuracy in transform output by providing better tooling HOT 3
- provide trace checker and debug mode with it enabled HOT 2
- python `slice` is not represented properly in thunder
- [NeVa] thunder.core.interpreter.InterpreterError: Encountered exception IndexError: list index out of range while tracing GraphModule HOT 4
- Recipes and high-level entrypoint HOT 5
- Enable NvtxProfileTransform by default HOT 6
- `Tensor.copy_` tries to copy onto an intermediate tensor in a canonicalized trace
- Propagate tag information throughout a trace lifetime 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 lightning-thunder.