-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify function implementation returned by thunder.jit for easier instrumentation of different stages #1333
Conversation
for more information, see https://pre-commit.ci
CI failures that I need to take a look what's going on: =========================== short test summary info ============================
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-llama1-like] - TypeError: tuple indices must be integers or slices, not tuple
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-codellama2-like] - TypeError: tuple indices must be integers or slices, not tuple
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-falcon-40b-like] - TypeError: tuple indices must be integers or slices, not tuple
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-long-context-like] - TypeError: tuple indices must be integers or slices, not tuple
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-llama2-like] - TypeError: tuple indices must be integers or slices, not tuple
FAILED thunder/tests/test_jit_general.py::test_litgpt_variants_kvcache[cpu-falcon-7b-like] - TypeError: tuple indices must be integers or slices, not tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Is this one of the timers that mixology is using? If so, we may want to hold off on this part. @mpatel31415 ? |
No, we use |
oh, great! I thought you were using some timers, though---how are you measuring compilation time, if not using these CompileStats timers? |
We measure 2N iterations giving us iter_times = [t1, t2, .. t_2N] and we assume that compilation (and warmup) time is sum(iter_times[:N]) - sum(iter_times[N:]). In this way it's easy to measure it irrespective of the compilation method in the same way. |
Oh! That's actually great news as I had (incorrectly) thought you were using the timers, and this makes it easier for us to change that interface. Thanks! |
Looks like tests pass and this is good to go, AFAICT. @t-vi merge? |
So when will we be able to drop the timers? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @IvanYashchuk @mpatel31415 @tfogal
Seems good, I would want to drop all the timings gathered here very soon unless there is a user for them.
From what I understand, people interested in timings do profile things.
I can start looking at this after #1268 |
This PR changes the
thunder.jit.fn_
implementation to use just a few lines of code making it more readable and amenable to per-function instrumentation like cProfile, pyinstrument, or NVTX decorators.I removed a few unused timer measurements or if there was just a stop with no start. Other than that all CompileStats time measurements are preserved in this PR.
There was a todo to rename "last_executed" to "last_computation", this change is included here.
Here is what the function looks like now: