Lightning-AI / Lightning-AI/lightning-thunder

Investigate GPU memory intense CI tests

Open
#394 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ci / tests memory use
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

We should look at how these are run. The numebrs are GB GPU memory, listing all that are > 0.6. (We could change to >0.5 as the threshold, but it does not matter).

Maybe we should enforce the threshold of GPU memory use for the parallel tests.

test cuda memory use test_apex_cross_entropy[cuda-float32] 1 memory 0.7668776512145996
test cuda memory use test_populate_grads_nanogpt_torch_cuda_float32 1065 memory 2.0184102058410645
test cuda memory use test_populate_grads_nanogpt_nvfuser_cuda_float32 1066 memory 2.0110630989074707
test cuda memory use test_nanogpt_complete_torch_cuda_float32 1572 memory 0.7405362129211426
test cuda memory use test_nanogpt_complete_nvfuser_cuda_float32 1573 memory 0.7601151466369629
test cuda memory use test_nanogpt_complete_autograd_torch_cuda_float32 1575 memory 1.6154489517211914
test cuda memory use test_nanogpt_complete_autograd_nvfuser_cuda_float32 1576 memory 1.6141061782836914
test cuda memory use test_nanogpt_complete_cudagraphs_torch_cuda_float32 1577 memory 1.05192232131958
test cuda memory use test_nanogpt_complete_cudagraphs_nvfuser_cuda_float32 1578 memory 1.0715012550354004
test cuda memory use test_triton_cross_entropy[cuda-float16] 7555 memory 0.8328347206115723
test cuda memory use test_triton_cross_entropy[cuda-bfloat16] 7556 memory 0.8328347206115723
test cuda memory use test_triton_cross_entropy[cuda-float32] 7557 memory 1.0246472358703613
test cuda memory use test_triton_cross_entropy[cuda-float64] 7558 memory 2.1767783164978027
test cuda memory use test_triton_cross_entropy_vs_torch_consistency[cuda-float32] 7561 memory 0.7137904167175293
test cuda memory use test_triton_cross_entropy_vs_torch_consistency[cuda-float64] 7562 memory 2.0997800827026367

I will probably look at erroring on tests taking too much memory and are not run separately, and it could be that the limit might be 0.6GB.

If we find that the apex (#392) and triton cross entropy tests need the operand sizes, we should move them to be executed separately, either using the current setup (for test_networks) or a mechanism like #219 .

These have been disabled already in #393 and I filed #392.

test cuda memory use test_apex_cross_entropy_backward[cuda-float16] 4 memory 1.721745491027832
test cuda memory use test_apex_cross_entropy_backward[cuda-bfloat16] 5 memory 1.721745491027832
test cuda memory use test_apex_cross_entropy_backward[cuda-float32] 6 memory 2.872036933898926
test cuda memory use test_apex_cross_entropy_phantom_grad[cuda-float16] 7 memory 8.822380542755127
test cuda memory use test_apex_cross_entropy_phantom_grad[cuda-bfloat16] 8 memory 9.014111042022705
test cuda memory use test_apex_cross_entropy_phantom_grad[cuda-float32] 9 memory 9.401249408721924

cc @borda

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the parallel CUDA tests, the current test_networks setup, and #219 as references; begin by tracing how those tests are run. Completion means enforcing the agreed GPU-memory threshold for tests that are not isolated, or moving operand-size-sensitive Apex and Triton cases to separate execution, then verifying the CI behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
ci-cd, performance, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.