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

Integrate turbomind into sgl-kernel #2999

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

bjmsong
Copy link
Contributor

@bjmsong bjmsong commented Jan 20, 2025

@zhyncs

Checklist

@@ -0,0 +1,2 @@
include src/sgl-kernel/turbomind/lib/_turbomind_ext.cpython-312-x86_64-linux-gnu.so
Copy link
Member

Choose a reason for hiding this comment

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

Why is the Python version specified here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because pybind11 is used in building

Copy link
Member

@zhyncs zhyncs Jan 20, 2025

Choose a reason for hiding this comment

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

We can’t hardcode the Python version

.gitmodules Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
import sgl_kernel.turbomind.lib._turbomind_ext as _turbomind_ext
Copy link
Member

Choose a reason for hiding this comment

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

Please run make format

sgl-kernel/src/sgl-kernel/__init__.py Outdated Show resolved Hide resolved
@zhyncs
Copy link
Member

zhyncs commented Jan 20, 2025

BTW Can we only use the C++ and CUDA code from turbomind's third-party library? We can handle the pybind11 interface in the sgl-kernel, eliminating the need for turbomind runtime requirements.

@zhyncs zhyncs self-assigned this Jan 20, 2025
@zhyncs
Copy link
Member

zhyncs commented Jan 20, 2025

BTW we should ensure the PR Test (sgl-kernel) is successful.

@bjmsong bjmsong requested a review from Ying1123 as a code owner January 20, 2025 09:43
@@ -22,6 +22,9 @@ docker run --rm \
export SGL_KERNEL_ENABLE_SM90A=${ENABLE_SM90A} && \
mkdir -p /usr/lib/x86_64-linux-gnu/ && \
ln -s /usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so && \
cd /sgl-kernel && \
cd /sgl-kernel/3rdparty/turbomind && \
Copy link
Member

Choose a reason for hiding this comment

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

We should handle the build process internally within setup.py, not this way.

extra_link_args = [
"-Wl,-rpath,$ORIGIN/../../torch/lib",
"-L/usr/lib/x86_64-linux-gnu",
f"{str(root)}/3rdparty/turbomind/build/lib/libgemm2.a",
Copy link
Member

Choose a reason for hiding this comment

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

same as above

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