Skip to content

Conversation

@jinhongyii
Copy link
Contributor

add fp4 codegen/runtime support

@jinhongyii
Copy link
Contributor Author

cc: @tqchen

@yongwww
Copy link
Member

yongwww commented Feb 26, 2025

CI failed due to the ml_dtypes version, #17686 is trying to upgrade ml_dtypes

@yongwww
Copy link
Member

yongwww commented Feb 27, 2025

hmm, the ml_dtypes>=0.5.1 was installed, but was downgraded to 0.4 during tensorflow install: https://ci.tlcpack.ai/blue/rest/organizations/jenkins/pipelines/tvm-docker/branches/main/runs/2062/nodes/50/steps/114/log/?start=0

@yongwww
Copy link
Member

yongwww commented Feb 27, 2025

tensorflow 2.18.0 requires ml-dtypes<0.5.0,>=0.4.0, but you have ml-dtypes 0.5.1 which is incompatible.

@yongwww
Copy link
Member

yongwww commented Feb 27, 2025

one workaround is to install tensorflow w/o checking the dependencies: pip install tensorflow==2.18.0 --no-deps, I’m not sure if TensorFlow will work for the ci workloads, I’ll build an image manually to verify this.

} else if (lanes == 4) {
vec = "x4";
} else {
LOG(FATAL) << "Only support scalar and vector types of width (2, 4, 8) for FP8";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LOG(FATAL) << "Only support scalar and vector types of width (2, 4, 8) for FP8";
LOG(FATAL) << "Only support scalar and vector types of width (2, 4) for FP4";

if (type.code() == DataType::kE2M1Float) {
suffix = "_e2m1";
} else {
LOG(FATAL) << "Unsupported FP8 type in CUDA codegen";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LOG(FATAL) << "Unsupported FP8 type in CUDA codegen";
LOG(FATAL) << "Unsupported FP4 type in CUDA codegen";

@yongwww
Copy link
Member

yongwww commented Feb 27, 2025

ci is green, the manually built cpu and GPU images work well. We can go ahead with the manually built images. I will follow-up to use automatic built images later once #17691 lands

@MasterJH5574
Copy link
Contributor

Thank you so much for getting the CI ready ❤️ @yongwww!

@yongwww yongwww merged commit 7bedfeb into apache:main Feb 28, 2025
17 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
* fp4

* fix test

* fix lint

* fix

* Test with manually built images

---------

Co-authored-by: Yong Wu <[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