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

[AMD][ROCm][CI] unit tests fixes or skip #5323

Closed

Conversation

hongxiayang
Copy link
Collaborator

@hongxiayang hongxiayang commented Jun 6, 2024

This pull request has the following changes:

  • fix or skip distributed and quantization unit tests

FIX #xxxx (link existing issues this PR will resolve)

BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE


PR Checklist (Click to Expand)

Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.

PR Title and Classification

Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:

  • [Bugfix] for bug fixes.
  • [CI/Build] for build or continuous integration improvements.
  • [Doc] for documentation fixes and improvements.
  • [Model] for adding a new model or improving an existing model. Model name should appear in the title.
  • [Frontend] For changes on the vLLM frontend (e.g., OpenAI API server, LLM class, etc.)
  • [Kernel] for changes affecting CUDA kernels or other compute kernels.
  • [Core] for changes in the core vLLM logic (e.g., LLMEngine, AsyncLLMEngine, Scheduler, etc.)
  • [Hardware][Vendor] for hardware-specific changes. Vendor name should appear in the prefix (e.g., [Hardware][AMD]).
  • [Misc] for PRs that do not fit the above categories. Please use this sparingly.

Note: If the PR spans more than one category, please include all relevant prefixes.

Code Quality

The PR need to meet the following code quality standards:

  • We adhere to Google Python style guide and Google C++ style guide.
  • Pass all linter checks. Please use format.sh to format your code.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Include sufficient tests to ensure the project to stay correct and robust. This includes both unit tests and integration tests.
  • Please add documentation to docs/source/ if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.

Notes for Large Changes

Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with rfc-required and might not go through the PR.

What to Expect for the Reviews

The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:

  • After the PR is submitted, the PR will be assigned to a reviewer. Every reviewer will pick up the PRs based on their expertise and availability.
  • After the PR is assigned, the reviewer will provide status update every 2-3 days. If the PR is not reviewed within 7 days, please feel free to ping the reviewer or the vLLM team.
  • After the review, the reviewer will put an action-required label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.
  • Please respond to all comments within a reasonable time frame. If a comment isn't clear or you disagree with a suggestion, feel free to ask for clarification or discuss the suggestion.

Thank You

Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!

@hongxiayang hongxiayang marked this pull request as ready for review June 6, 2024 20:03
@WoosukKwon WoosukKwon added the rocm label Jun 7, 2024
Copy link
Contributor

@hliuca hliuca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used Hongxia's branch and built on MI300X, and the changes in build scripts fixed the issue. Thanks.

@hongxiayang
Copy link
Collaborator Author

I have used Hongxia's branch and built on MI300X, and the changes in build scripts fixed the issue. Thanks.

Thank you @hliuca for verifying the change on MI300x.

Copy link
Contributor

@hliuca hliuca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified the build and things look good..

@hongxiayang
Copy link
Collaborator Author

@WoosukKwon As discussed in our last meeting, this is a critical fix. Please review this. Thank you very much !

@WoosukKwon WoosukKwon self-assigned this Jun 8, 2024
Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hongxiayang Huge thanks for the PR! Didn't know that the current docker file has such a critical bug.

Left minor comments on the code style. Please take a look!

docs/source/getting_started/amd-installation.rst Outdated Show resolved Hide resolved
Dockerfile.rocm Outdated Show resolved Hide resolved
Dockerfile.rocm Outdated Show resolved Hide resolved
Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comment!

Dockerfile.rocm Show resolved Hide resolved
@WoosukKwon
Copy link
Collaborator

@hongxiayang Also, please resolve the merge conflicts so that I can merge :)

@hongxiayang
Copy link
Collaborator Author

@hongxiayang Also, please resolve the merge conflicts so that I can merge :)

Resolved the merge conflicts. Thanks!

Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the PR!

@WoosukKwon
Copy link
Collaborator

@hongxiayang The AMD CI failed. Could you please take a look?

@hongxiayang
Copy link
Collaborator Author

@hongxiayang The AMD CI failed. Could you please take a look?

@WoosukKwon Fixed several CI failures.

Comment on lines 43 to 53
def test_compressed_tensors_no_enforce_eager(vllm_runner):
model_path = "nm-testing/tinyllama-oneshot-w8a8-static-v2"
with vllm_runner(model_path) as llm:
sampling_params = SamplingParams()
output = llm.generate("Hello world!", sampling_params=sampling_params)
assert output


def test_compressed_tensors_w8a8_dynanmic_per_token(vllm_runner):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hongxiayang Is it safe to delete these tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I only add a decorator to skip. Need to look at why it is deleted.

@WoosukKwon
Copy link
Collaborator

@hongxiayang Thanks for update the PR! I will merge it once it passes the AMD CI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here don't seem to have fixed the AMD distributed test, if they don't help we should remove them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it worked on my local env. Again, we should revisit unit tests when we introduce a new feature.

Copy link
Contributor

@mawong-amd mawong-amd Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quantization test errors are unrelated to ROCm. We should not unilaterally skip tests that are also broken in upstream: when these are fixed we will lose tests for no reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) I got this error when I ran this test: "ValueError: compressed-tensors quantization is currently not supported in ROCm.".
ROCm did not support it right now.
(2) we should revisit the test if this is supported by ROCm. We will need to borrow pytorch practice eventually to book keep all the skip tests and do parity review periodically.

@hongxiayang
Copy link
Collaborator Author

hongxiayang commented Jun 13, 2024

it seems the @skipIfRocm is broken in this CI even it works fine in my local env if I ran it locally, and expecttest package was inside the container.

root:/vllm-workspace/tests/quantization# pip show expecttest
Name: expecttest
Version: 0.1.6
Summary: 
Home-page: https://github.com/ezyang/expecttest
Author: Edward Z. Yang
Author-email: ezyang@mit.edu
License: MIT
Location: /opt/conda/envs/py_3.10/lib/python3.10/site-packages
Requires: 
Required-by: 

and test

root:/vllm-workspace/tests/quantization# pytest test_compressed_tensors.py 
========================================================================== test session starts ===========================================================================
platform linux -- Python 3.10.14, pytest-7.3.2, pluggy-1.4.0
rootdir: /vllm-workspace
configfile: pyproject.toml
plugins: shard-0.1.2, xdoctest-1.1.0, xdist-3.3.1, flakefinder-1.1.0, cpp-2.3.0, rerunfailures-14.0, hypothesis-5.35.1, asyncio-0.23.7, anyio-4.4.0
asyncio: mode=strict
collected 3 items                                                                                                                                                        
Running 3 items in this shard

test_compressed_tensors.py sss                                                                                                                                     [100%]

=========================================================================== 3 skipped in 1.93s ===========================================================================

The CI complains that the expecttest module :
image

@WoosukKwon
Copy link
Collaborator

@hongxiayang It seems there are 3 failed tests in the AMD CI. Is this expected?

@WoosukKwon WoosukKwon closed this Jun 13, 2024
@WoosukKwon WoosukKwon reopened this Jun 13, 2024
@hongxiayang
Copy link
Collaborator Author

@hongxiayang It seems there are 3 failed tests in the AMD CI. Is this expected?

@WoosukKwon I am looking. Seems each rebase will bring out something new.
For the engine test failure related to test_stop_strings.py:
I consulted several folks, and got slightly different answers.
I am not completely certain whether we should expect the same output for the same prompt for all cases to compare with non-AMD GPUs.

See below:
image

@WoosukKwon
Copy link
Collaborator

Now the AMD CI finally ran, but the tests failed because of the new Numpy 2.0 release 😭
@hongxiayang I'm really sorry for this, but could you update the PR to fix the error?

@hongxiayang
Copy link
Collaborator Author

Now the AMD CI finally ran, but the tests failed because of the new Numpy 2.0 release 😭 @hongxiayang I'm really sorry for this, but could you update the PR to fix the error?

@WoosukKwon thanks. I rebased my branch which picked up the change requiring numpy < 2.0. Now the CI is failing on some ssl errors, for example:
image

@WoosukKwon
Copy link
Collaborator

WoosukKwon commented Jun 17, 2024

@hongxiayang Just restarted the tests with SSL errors and it seems they work now. However, the PR still has failures in the AMD CI tests. Could you please take a look?

@hongxiayang
Copy link
Collaborator Author

@WoosukKwon Our customers are still waiting for this fix. The longer we wait, the more unit tests I may have to fix since more people are adding more unit tests. To make the build fix easier to merge, I will split this PR to two or more small PRs. Hope this is ok for you. The first splited PR will just contain the cmake fix. That will at least enable the customers build their own docker image correctly on MI300x with ROCm 6.1 or 6.1.2. cc @hliuca

@WoosukKwon
Copy link
Collaborator

@hongxiayang Sounds good. Please go ahead. Or, do you think it makes sense to merge the current PR?

@WoosukKwon
Copy link
Collaborator

I think there are two types of error: 1. A Ray related error and 2. a correctness error. I think the correctness error could be because the new ROCm release might include changes in its libraries like hipBLAS, which in turn causes small numerical differences.

@hongxiayang
Copy link
Collaborator Author

hongxiayang commented Jun 18, 2024

I think there are two types of error: 1. A Ray related error and 2. a correctness error. I think the correctness error could be because the new ROCm release might include changes in its libraries like hipBLAS, which in turn causes small numerical differences.

Thanks. For (1) I did some research/investigations related to test_utils.py in tests/distributed. It may need to wait until a newer ROCm/pytorch release.
For (2) the test_stop_string.py related. Investigation is still underway, and there is no concrete conclusion yet.

@hongxiayang
Copy link
Collaborator Author

hongxiayang commented Jun 18, 2024

@hongxiayang Sounds good. Please go ahead. Or, do you think it makes sense to merge the current PR?

Thanks. The first split PR is #5641.
I might split the fixes for the unit tests to a different PR.

@hongxiayang hongxiayang changed the title [Bugfix][CI/Build][Upgrade][AMD][ROCm]Fixed the cmake build bug which generate garbage on mi300x and rocm6.1 upgrade [Upgrade][AMD][ROCm] rocm6.1 upgrade Jun 19, 2024
@hongxiayang hongxiayang changed the title [Upgrade][AMD][ROCm] rocm6.1 upgrade [AMD][ROCm][CI] unit tests fixes or skip Jun 19, 2024
@hongxiayang
Copy link
Collaborator Author

Since cmake fix (#5641) is merged, I am repurposing this PR to only include changes to skip or fix failed unit tests.

@WoosukKwon
Copy link
Collaborator

@hongxiayang Sounds great! Could you please update the PR to resolve the merge conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants