Skip to content

Conversation

yannicks1
Copy link
Collaborator

@yannicks1 yannicks1 commented Mar 24, 2025

[GPTQ] fails to start with upstream aiu-fms repository

closes #42

changes:

  • fix import in model loader (here)

Tested successfully on AIU Spyre with granite 8b.

Copy link

👋 Hi! Thank you for contributing to vLLM support on Spyre.
Just a reminder: Make sure that your code passes all the linting checks, otherwise your PR won't be able to be merged. To do so, first install the linting requirements, then run format.sh and commit the changes:

pip install -r requirements-lint.txt
bash format.sh

Now you are good to go 🚀

@yannicks1 yannicks1 marked this pull request as ready for review March 25, 2025 10:30
logger.info("Loaded `aiu_addons` functionalities")
else:
from cpu_addon import cpu_linear # noqa: F401
linear_type = "gptq_cpu"
Copy link
Member

Choose a reason for hiding this comment

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

Should we perhaps just raise an exception here (since we don't expect it to work)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I inserted a logger warning. This way it does not directly raise an exception if this should work in the future due to some changes in the fms repos.

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't work now, I would still prefer to raise an exception rather than warning if it is unsupported configuration. Exception is much better feedback to the user.

Signed-off-by: Yannick Schnider <[email protected]>
@yannicks1 yannicks1 requested a review from tdoublep March 25, 2025 12:56

if envs_spyre.VLLM_SPYRE_DYNAMO_BACKEND == "sendnn_decoder":
from aiu_as_addon import aiu_adapter, aiu_linear # noqa: F401
from fms_mo.aiu_addons.gptq import ( # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the above sys.path.append("/home/senuser/aiu-fms") still required now that the fms_mo package exists? It's not clear from the comment what we're actually importing from that path

Copy link
Collaborator

@joerunde joerunde Mar 25, 2025

Choose a reason for hiding this comment

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

Also, we should ideally be tracking fms_mo as a dependency, but I'm assuming that it's not published to pypi yet, right? Ah JK I see it is released here, though it looks like there isn't much activity on getting new releases pushed: https://pypi.org/project/fms-model-optimizer/#history

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have not tried gptq but yes I agree we may not need aiu-fms anymore as everything there should be either in fms_mo or in fms.

Copy link
Member

Choose a reason for hiding this comment

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

Agree we need to add fms_mo as a dep.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, I could not find any other dependencies on aiu-fms and thus removed it.

Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
Signed-off-by: Yannick Schnider <[email protected]>
@yannicks1
Copy link
Collaborator Author

I am struggling to add fms_mo as a dependency in requirements.txt (see my last two commits). Does this have to happen as part of this PR. If yes, can you possibly help @dpatel-ops ?

@joerunde
Copy link
Collaborator

@yannicks1 it looks like fms-mo only supports python <=3.11, but our build uses python 3.12

We could downgrade our build to 3.11, or work with the fms-mo team to build for 3.12 as well. Usually that's a simple build config setting, but I don't know enough to know if fms-mo specifically has problems supporting 3.12.

I would prefer to get a release of fms-mo supporting 3.12, but if we need to get this change in with some README updates that mention gptq support is only on py311 that would be okay as well.

Signed-off-by: Yannick Schnider <[email protected]>
@yannicks1 yannicks1 requested a review from joerunde March 27, 2025 15:58
@joerunde
Copy link
Collaborator

Shoot, it looks like with torch 2.5.1 the install of triton might brick model loading with vllm 0.8.2 :(

@tjohnson31415
Copy link
Collaborator

tjohnson31415 commented Mar 27, 2025

Shoot, it looks like with torch 2.5.1 the install of triton might brick model loading with vllm 0.8.2 :(

I reset my dev environment and installed vllm 0.8.2 with fms_mo (hacked to install with Python 3.12, also had to uninstall torchvision) and it doesn't raise the TypeError: must be called with a dataclass type or instance error. fms_mo pins triton < 3.2 and it is actually triton==3.2 with torch==2.5.1 that seem to be incompatible.

I don't know enough to know if fms-mo specifically has problems supporting 3.12.

I did see a note in the README:

📋 Python 3.12 is currently not supported due to PyTorch Dynamo constraint

Though that may be an out-of-date note. This PyTorch issue indicates that it was made compatible in PyTorch 2.4.

@joerunde
Copy link
Collaborator

Though that may be an out-of-date note. pytorch/pytorch#120233 (comment) indicates that it was made compatible in PyTorch 2.4.

Interesting, I had actually assumed that some part of fms-mo that used dynamo required updating based on changes in python 3.12. But you know what happens when you assume lol

@yannicks1 I opened an issue for handling dependencies here: #61

If you want to, I think I'd be fine merging this in without the dependencies specified, but I'll leave it up to you.

Copy link
Collaborator

@joerunde joerunde left a comment

Choose a reason for hiding this comment

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

LGTM given that we have issues open to add tests and specify dependencies correctly. Looks like it'll be a bit more work to get that all set up, I'm fine if we merge first and follow up with those

@yannicks1
Copy link
Collaborator Author

Thanks @joerunde and @tjohnson31415 for digging a bit deeper here. Looks like a non-trivial thing to solve, will merge this and we deal with the dependencies in this issue #61 (thanks for opening this Joe).

@yannicks1 yannicks1 merged commit c720b8f into main Mar 28, 2025
9 checks passed
@yannicks1 yannicks1 deleted the ysc-gptq-fix branch March 28, 2025 12:15
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.

[GPTQ] fails to start with upstream aiu-fms repository

5 participants