Commit Graph
37 Commits
Author SHA1 Message Date
Vaibhav Jindal 0a5e9a55f8 Update tests.py to use B200 instead of B200! (#1437)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
"B200!" is not a defined GPU type unlike "H100!". Need to use "B200"
instead of "B200!" at all locations.

Refer: https://modal.com/docs/guide/gpu#b200-gpus

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2026-09-02 17:45:50 +00:00
1621f42d7e ci(nvi): add cuTile tests on B200 to the daily run (#1436)
## Summary

Adds a B200 (SM100) counterpart to the daily H100 cuTile CI job, so the
cuTile suite runs on **both** archs — mirroring cuTeDSL, which already
runs on H100 and B200. Arch-specific cuTile regressions (e.g.
SM100/tcgen05 codegen issues) would otherwise go uncaught by CI.

## Changes

- **`dev/modal/tests.py`** — new `liger_cutile_tests_b200` Modal
function, identical to `liger_cutile_tests` but on B200. Installs
`.[dev,cutile-tileiras]` (so `import cuda.tile` resolves and the tests
run rather than `importorskip`) and runs `make test-cutile` (which sets
`LIGER_KERNEL_IMPL=cutile`).
- **`.github/workflows/nvi-ci.yml`** — adds a `cuTile (B200)` entry to
the `daily` matrix and refreshes the surrounding comments.

## Strict `B200!` GPU spec

Both B200 jobs now use the strict `gpu="B200!"` form, matching the H100
jobs' `H100!`. The `!` tells Modal not to substitute a different GPU
family. This matters for arch-specific SM100 tests: without it, a
fallback/substituted GPU could produce a **misleading pass**. This PR
also flips the pre-existing `liger_cutedsl_tests_b200` from `"B200"` →
`"B200!"` for consistency (small, related change — easy to drop if
undesired).

`max-parallel: 3` and the workflow-level concurrency group are
unchanged, so the 5th daily matrix entry still runs at most 3 GPU jobs
at once.

## Verification

Locally on a B200: `LIGER_KERNEL_IMPL=cutile pytest test/cutile/` →
**199 passed, 12 skipped**. The new job is meaningful and currently
green on B200.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-09-01 23:00:26 +00:00
Vaibhav JindalandCopilot 00e72b86ca ci: schedule NVIDIA tests by cadence/GPU with a hard 3-job concurrency cap (#1415)
## Summary

Reorganizes the **NVIDIA GPU** workflow into a cadence- and GPU-aware
schedule, and adds the Modal functions to back it. Follows up #1410
(which added the per-DSL test folders and `make test-cutile` /
`test-cutedsl` / `test-cute` targets).

### Schedule

**Daily** (cron `24 9 * * *`):
| Suite | GPU | Modal fn |
|---|---|---|
| general correctness | H100 | `liger_correctness_tests` |
| cuTile | H100 | `liger_cutile_tests` (new) |
| cuTeDSL — SM90 half | H100 | `liger_cutedsl_tests_h100` (new) |
| cuTeDSL — SM100 half | B200 | `liger_cutedsl_tests_b200` (new) |

cuTeDSL runs on **both** archs on purpose: its SM90 tests only run on
H100 and its SM100 tests only run on B200 — each arch self-skips the
other half, so both are needed for full coverage.

**Weekly** (cron `24 13 * * 0`, Sundays, H100): `convergence` (latest
tf) + oldest-supported-tf **correctness** and **convergence**.

**Not scheduled:** `cute` (fused-MoE) tests, for now.

### The ≤3-concurrent fix

A 4th simultaneous Modal GPU call was being rejected (one job died
instantly at ~0.7 min). This is now capped two ways:
- **`strategy.max-parallel: 3`** on each matrix job (daily's 4 entries
run 3-then-1; weekly's 3 run together).
- **Workflow-level `concurrency: { group: <workflow>,
cancel-in-progress: false }`** serializes whole runs, so the daily and
weekly runs never overlap.

Only **one** cadence job activates per trigger (the job-level `if`
selects daily vs weekly from `github.event.schedule` / the
`workflow_dispatch` `suite` input), so at most **3** GPU jobs ever run
together. The `if` deliberately uses only the `github` context — **not**
the `matrix` context, which isn't available in a job-level `if`.

### Manual runs
`workflow_dispatch` gains a `suite` input (`daily` / `weekly`, default
`daily`).


## Notes / caveats
- **Convergence is currently red** on `main`'s scheduled runs
(pre-existing; correctness passes). Weekly scheduling is fine but expect
failures until that's fixed separately.
- **DSL suites run in CI for the first time** — the cuTeDSL-B200 (SM100)
path and the cuTile routing test may surface latent failures on first
run.
- **B200 access**: uses `gpu="B200"` on Modal — confirm the token/plan
has B200 capacity.
- `cuTile` installs the `cutile-tileiras` extra so `import cuda.tile`
resolves (otherwise those tests importorskip).
- Validated locally with a YAML parser + a gating simulation (exactly
one job per trigger) + modal-fn-name cross-check; `actionlint` wasn't
installable in the dev sandbox, and GPU suites can't run there.

Co-authored-by: Copilot <[email protected]>
2026-08-28 04:53:37 +00:00
Vaibhav JindalandCopilot f5df160741 Pin ruff version to <0.16.0 to avoid checkstyle breakage (#1318)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

ruff 0.16.0 changed formatting behavior for Python code fences embedded
in Markdown files, causing 'ruff format --check --diff' to flag
previously-formatted docs/skills markdown files as needing changes.
Since dev/fmt-requirements.txt and setup.py pinned only a lower bound
(ruff>=0.1.6 / ruff>=0.12.0), CI always installs the latest ruff, which
broke the merge queue checkstyle job for unrelated PRs.

Pin ruff to >=0.12.0,<0.16.0 in both setup.py and
dev/fmt-requirements.txt to keep checkstyle stable until the repo is
updated to support the new formatting behavior.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

Co-authored-by: Copilot <[email protected]>
2026-07-23 23:50:43 +00:00
Chun-Mao Lai 0cf4917645 Remove latest v4 test to reduce cost (#1098)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
We have too many tests right now. It costs too much.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2026-02-12 00:36:04 +00:00
175cdf0e37 Support transfomers v5 (#994)
>[!IMPORTANT]
>Do not merge this PR before all issues are resolved! 
>
>Testing with three versions: `4.52.0` , `4.57.6` and the latest stable
version

>[!NOTE]
>nvi-ci is split into correctness test ci and convergence test ci to
speed up testing in this PR
>, and more jobs for testing bc with transformers v4 (4.49.0 and 4.57.6)
>
>Whether keeping this change or not is yet to be discussed

## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
This is a dev branch for aggregating PRs related to transformers v5
changes.

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence

---------

Signed-off-by: Tcc0403 <[email protected]>
Co-authored-by: Yunwei Dai <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
Co-authored-by: Yuki Uehara <[email protected]>
Co-authored-by: Chun-Mao Lai <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
Co-authored-by: Michael Lai <[email protected]>
2026-02-12 00:01:06 +00:00
Jari Kolehmainen 498e58bc6d Fixing unit tests. (#1092)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->
Increasing transformers minimum version from 4.49.0 to 4.52.0 resolve
two unit test failures.

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->
unit testing.

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence
2026-02-11 10:25:58 -08:00
Vaibhav Jindal 24416a4286 Increase time limit for modal tests (#947)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Modal tests on nvidia gpus failing becuase of time limit errors:
https://github.com/linkedin/Liger-Kernel/actions/runs/19472103084/job/55721981739.

This PR increases the timeout to 90 mins to fix this.

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-11-20 17:02:43 -08:00
Vaibhav JindalandSteven Shimizu 389d9cf369 Fix tests and CI (#882)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->


1. Recent PR (https://github.com/linkedin/Liger-Kernel/pull/876) added
functionality to run tests in parallel. However, this leads to GPU OOM
errors breaking the CI. Even commands like
`pytest test/transformers/test_tvd.py` are not working on a single GPU
setup because of parallelism. This PR fixes this issue by changing the
behavior to run tests sequentially.

2. Fixes flaky tests for bf16 for glm4v models by increasing tolerance.

3. Use H100 for nvidia tests.

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Steven Shimizu <[email protected]>
2025-09-23 09:13:28 -07:00
fc8fd33b16 Giving an option to update benchmark results for previous commits. (#791)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
This pr does two things:
1) Making H100 a strict requirement
2) It gives an option to run benchmarks for any commit manually but with
the current (latest ie from main branch) benchmark scripts. This will
help us get accurate benchmarks results for previous commits after the
benchmark scripts are updated (merge this after the new benchmark
scripts are merged).
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-07-17 22:03:24 -07:00
Vaibhav Jindal 66570b1ae0 Update transformers version in tests-bwd and optional-deps, increase timeout, and fix tests-bwd (#794)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Update tests-bwd and optional-deps to use transformers version 4.49.0
instead of 4.44.2. Also, increase the timeout for tests.

For this change, the following modifications are also needed:
- Mllama monkey_patch fix
- Perform llava convergence tests for `transformers>=4.52.0` as we don't
materialize logits for earlier versions
- Increase test tolerance for `granite`
- Run `qwen2_vl` and `qwen2_5_vl` tests only for `transformers>=4.52.4`

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: H100
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence
2025-07-08 21:21:02 -07:00
Tcc0403 2c766fe468 style(benchmark-ci): remove extra empty line (#782)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-06-30 10:14:27 -07:00
d47751c5e3 Automate benchmarking - fixing typo (#779)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
There was a typo stating the GPU name, it should be H100.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-06-27 15:33:03 -07:00
ab151ab718 Automate benchmarking (#770)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Modal automatically upgrades H100 to H200, so for a strict constraint, I
have made this change.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-06-24 11:34:42 -07:00
c1bdc24546 Automate benchmarking (#760)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
This PR sets the time limit for the modal to run to 90 minutes and also
the workflow would be triggered every Friday.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-06-13 17:38:10 -07:00
Manan Shah 1f640a505a Trying out logprobs and top logprobs for testing rather than logits. (#745)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Just testing out logprobs as mentioned in #742 
It worked for the models where the test using logits was not working. 
Also, tried to setup 1e-1 tolerance for qwen (previously 1) and it
passed.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-06-13 14:20:47 -07:00
0bd8292d60 Automate benchmarking - changed the scripts for backward pass. (#759)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
The scripts are updated so that we get benchmarking results on backward
pass as well.
All benchmark scripts were run on a H100, it took around 55 minutes to
run.

There are total of 26 scripts, so each generates a plot for speed -
forward, backward and full pass
for memory - full pass. Total of 104.
And the output (csv file) was of 460kB.
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-06-13 12:26:38 -07:00
b6ed7357bd Automate benchmarking - downloading data from GPU to local (#756)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: Manan Shah <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>
2025-06-12 11:16:44 -07:00
Manan Shah c794a8f5f4 Automate benchmarking - disabling the docs workflow (#752)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
The docs workflow currently replaces the gh-pages branch with new files
due to which the benchmark data is lost. Currently I am disabling this
so that we can get the data appended in the gh-pages branch.
Also, modified the script to add commit hashes to a json file, so that
we do not call github api to fetch it due to API limitations
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-06-10 23:45:53 -07:00
Manan Shah 00fa58a999 Adding a test to run one benchmark when anything is pushed to the main branch (#744)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Trying to run just the KTO loss for now for testing purposes. It will
run after any thing is pushed to the main branch
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-06-05 14:01:31 -07:00
Shivam Sahni ea23cda90b fix modal tests (#719)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-05-16 18:27:48 -07:00
Vaibhav Jindal 352bae8cdd Increase tests timeout to 45 mins (#718)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
.. to fix nvidia tests failures due to timeout.

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2025-05-16 16:58:15 -07:00
Shivam SahniandmRSun15 bf2c67b77e Fix GRPO to conform with TRL: Fix loss, make tests accurate, correct metrics computation (#628)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Tries to address #626 and other correctness improvements
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Co-authored-by: mRSun15 <[email protected]>
2025-04-02 11:39:34 -07:00
1cc9c5083a Revert "Improve Hugging Face SFT Script (#539)" and Fix TVD Test for Intel #580 (#578)
This reverts commit 5476b20d3b.
The PR has an undefined `prepare_dataset` function which causes
checkstyle to fail
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence

---------

Signed-off-by: Austin Liu <[email protected]>
Co-authored-by: Austin Liu <[email protected]>
Co-authored-by: Shao Tang <[email protected]>
Co-authored-by: hebiao064 <[email protected]>
2025-02-21 15:02:19 -08:00
Shivam Sahni 77ff1a9b7d Move the checkstyle to [Ruff](https://docs.astral.sh/ruff/) (#483) 2024-12-22 20:21:17 -08:00
Byron Hsu 157af7141c Update tests_bwd.py 2024-12-11 21:53:44 -08:00
Byron Hsu 6c68bcb95b [CI] runtime pip install using uv (#471) 2024-12-11 19:05:48 -08:00
Byron Hsu 3a0cbdff4b Fix liger orpo trainer import error (#459)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

To fix https://github.com/linkedin/Liger-Kernel/issues/458

1. Move orpo trainer to trainer/
2. Remove trl from `[dev]` now so the test represents the actual user
environment.
3. Disable Qwen VL test for transformers>=4.47.0 for now and create
issue https://github.com/linkedin/Liger-Kernel/issues/461
## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-12-10 01:29:20 -08:00
ByronHsu e5ef0c0341 improve modal ci 2024-11-28 19:38:32 -08:00
Byron Hsu d87325dddd Fix os env (#416)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-11-28 19:34:07 -08:00
Byron Hsu 911c82e156 Add rebuild to CI (#415)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

The current modal image always uses cache, so it does not run with the
latest dependencies.

1. We `force_build` every night, and it pulls the latest dependencies
2. For CI and main commit, it uses the cache so it is faster

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence
2024-11-28 19:26:24 -08:00
Hongpeng GuoandByron Hsu 317ff432f9 Enable keyword arguments for liger functional (#400)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

This PR enables the keyword arguments of liger functional #368. 

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

1. Warp the Liger Operator Functions (`torch.autograd.Function`) with an
extra layer that can take key word arguments.
2. For each of the liger functions, updating its unit test function
`test_{operator_name}.py::test_correctness_functional` to reflect that
keyword args can be accepted.

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type:  A10G
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence

---------

Signed-off-by: Hongpeng Guo <[email protected]>
Co-authored-by: Byron Hsu <[email protected]>
2024-11-21 14:57:28 -08:00
Byron Hsu 5ef09d5fd7 Support CE after grad acc fix (#375)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->
Based on https://github.com/linkedin/Liger-Kernel/pull/374, but make it
leaner
1. The use of cross entropy in model code has changed after grad fix
2. It changed from module CrossEntropy to functional cross_entropy
3. Our monkey patching needs to change accordingly
4. While also make sure backward compatibility by adding a condition for
different versions

Notable Changes

1. Add a functional api for CE to take keyword args
2. Add back conv test with logits to test CE convergence
3. Add back comp test for transformers 4.44

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence
2024-11-12 12:49:36 -08:00
Byron Hsu 98d77e077d broadcast grad acc fix to all models (#354)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

follow up for https://github.com/linkedin/Liger-Kernel/pull/339

However, identify few issues
1. revert patching causes flce not taking effect (comment out revert
patching for now, and only test float32)
2. qwen2 vl flce is broken. we should fix later
3. we should provide a real "on-instance" patch that does not use any
monkey patch. now the on-instance patch still relies on monkey patch

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-11-05 14:05:27 -08:00
Byron Hsu ef3f55dcd0 merge two tests into one (#349)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

remove the launching overhead of the 2nd container

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-11-04 17:04:47 -08:00
Byron Hsu a2dfa3cb2f Aggressively trim test bloat (#346)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

1. Disable the test for experimental kernels
2. Reduce the size of tensor if the tests takes too long
3. Remove redundant tests that are testing the same thing

Make sure unit test time < 5 mins

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-11-04 14:04:40 -08:00
Byron Hsu c34843c45e set up modal ci (#344)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->

<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->

follow https://github.com/modal-labs/ci-on-modal

## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->

<!-- 
Replace BLANK with your device type. For example, A100-80G-PCIe

Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them. 
-->

- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
2024-11-04 13:08:19 -08:00