Skip to content
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

Xpu support #407

Merged
merged 10 commits into from
Nov 23, 2024
Merged

Xpu support #407

merged 10 commits into from
Nov 23, 2024

Conversation

mgrabban
Copy link
Collaborator

Summary

Replica of #396
Adds xpu support so all tests, benchmarks etc. run on XPUs or Intel GPUs.

Details

infer_device() function is moved to a separate file and in any file where previously "cuda" was needed, infer_device is imported and "cuda" is replaced with return value of a call to infer_device()

Testing Done

A100 80GB PCIe, RTX 3060, Intel Data Center GPU Max 1550

  • Hardware Type:
  • run make test to ensure correctness
  • run make checkstyle to ensure code style
  • run make test-convergence to ensure convergence

@mgrabban mgrabban mentioned this pull request Nov 22, 2024
3 tasks
@ByronHsu
Copy link
Collaborator

can you fix the checkstyle?

@mgrabban
Copy link
Collaborator Author

can you fix the checkstyle?

done now.

@ByronHsu ByronHsu merged commit 7e3683e into main Nov 23, 2024
3 checks passed
@ByronHsu ByronHsu deleted the xpu_support branch November 23, 2024 04:03
@austin362667 austin362667 mentioned this pull request Nov 29, 2024
3 tasks
ByronHsu pushed a commit that referenced this pull request Nov 30, 2024
## Summary

Closes #411

1. The convergence tests all passed in the latest commit
([PR#407](#407)). Its CI
worked fine:
https://github.com/linkedin/Liger-Kernel/actions/runs/11983838113/job/33413899589?pr=407#step:5:984

2. Without any code changes inside Liger, the convergence tests now
failed in QWEN2VL cases, referring to
#411.

The root cause of this is solely because huggingface released new
transformers which modified QWEN2VL.
Since it's not a bug within liger qwen2vl impl, it's okay to slightly
adjust the `rtol`s a bit.

BTW, seems there's some context maybe related:

https://github.com/linkedin/Liger-Kernel/blob/0137757dcf769deac2b14646b7ab61374b8a58f6/test/convergence/test_mini_models.py#L530

## Testing Done

Yes.

Full log below,

```
test/convergence/test_mini_models.py::test_mini_model[mini_llama3-32-0.0001-dtype0-1e-08-2e-05-0.0001-1e-05-0.005-1e-05] PASSED [  5%]
test/convergence/test_mini_models.py::test_mini_model[mini_llama3-32-0.0001-dtype1-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 11%]
test/convergence/test_mini_models.py::test_mini_model[mini_mllama-32-0.0001-dtype2-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [ 17%]
test/convergence/test_mini_models.py::test_mini_model[mini_mllama-32-0.0001-dtype3-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 23%]
test/convergence/test_mini_models.py::test_mini_model[mini_qwen2-32-0.0001-dtype4-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [ 29%]
test/convergence/test_mini_models.py::test_mini_model[mini_qwen2-32-0.0001-dtype5-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 35%]
test/convergence/test_mini_models.py::test_mini_model[mini_qwen2_vl-32-0.0001-dtype6-8e-06-0.04-0.005-1e-05-0.005-1e-05] PASSED [ 41%]
test/convergence/test_mini_models.py::test_mini_model[mini_qwen2_vl-32-0.0001-dtype7-0.001-0.05-0.1-0.01-0.01-0.01] PASSED [ 47%]
test/convergence/test_mini_models.py::test_mini_model[mini_phi3-32-0.0001-dtype8-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [ 52%]
test/convergence/test_mini_models.py::test_mini_model[mini_phi3-32-0.0001-dtype9-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 58%]
test/convergence/test_mini_models.py::test_mini_model[mini_mistral-32-0.0001-dtype10-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [ 64%]
test/convergence/test_mini_models.py::test_mini_model[mini_mistral-32-0.0001-dtype11-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 70%]
test/convergence/test_mini_models.py::test_mini_model[mini_gemma1-32-0.0001-dtype12-1e-08-0.0001-0.005-1e-05-0.005-1e-05] PASSED [ 76%]
test/convergence/test_mini_models.py::test_mini_model[mini_gemma1-32-0.0001-dtype13-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 82%]
test/convergence/test_mini_models.py::test_mini_model[mini_gemma1.1-32-0.0001-dtype14-1e-08-0.0001-0.005-1e-05-0.005-1e-05] PASSED [ 88%]
test/convergence/test_mini_models.py::test_mini_model[mini_gemma1.1-32-0.0001-dtype15-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [ 94%]
test/convergence/test_mini_models.py::test_mini_model[mini_gemma2-32-0.0001-dtype16-1e-08-0.0001-0.005-1e-05-0.005-1e-05] PASSED [100%]

================== 17 passed, 1 warning in 163.58s (0:02:43) ===================
```

- 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: Austin Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants