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

Installation for Triton #1410

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parsifal-47
Copy link

Hello All,
This PR Integrates Triton (https://github.com/triton-lang/triton) to compiler explorer's infra. It also includes CPU backend from https://github.com/microsoft/triton-shared

It almost works, I see the following:

$ ./bin/ce_install install triton
...
Successfully built triton
Installing collected packages: filelock, triton
Successfully installed filelock-3.16.0 triton-2.1.0
2024-09-16 02:40:59,801 lib.installation_context INFO     Moving from staging (/opt/compiler-explorer/staging/ed9924e0-5a73-46b5-aa3b-6a24632e455d/triton-2.1.0) to final destination (/opt/compiler-explorer/triton-2.1.0)
2024-09-16 02:40:59,831 lib.installation_context INFO     Destination /opt/compiler-explorer/triton-2.1.0 exists, temporarily moving out of the way (to /opt/compiler-explorer/staging/ed9924e0-5a73-46b5-aa3b-6a24632e455d.orig)
2024-09-16 02:40:59,831 lib.installation_context INFO     Removing temporarily moved /opt/compiler-explorer/staging/ed9924e0-5a73-46b5-aa3b-6a24632e455d.orig
2024-09-16 02:41:00,036 lib.ce_install  ERROR    compilers/triton 2.1.0 installed OK, but doesn't appear as installed after
Installing libraries/triton/triton-shared main
2024-09-16 02:41:00,036 lib.ce_install  INFO     libraries/triton/triton-shared main is already installed, skipping
0 packages installed OK, 1 skipped, and 1 failed installation
Failed:
  compilers/triton 2.1.0

What am missing?

Besides that, I am open for discussion, let me know what you think!
Thank you!

Copy link
Member

@mattgodbolt mattgodbolt left a comment

Choose a reason for hiding this comment

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

Hi! sorry it's bad news here -- supporting compilers written in python hasn't been very easy for us to support in the past, and I think you're falling foul of that here.

- compilers/c++/clang 18.1.0
- libraries/triton/triton-shared main
compression: gz
check_exe: python3 venv/lib/python3.12/site-packages/triton/tools/compile.py -h
Copy link
Member

Choose a reason for hiding this comment

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

This is probably the culprit here. We don't have a "real" python3 in our environment where the compilers run and/or are installed. As you know python has a rich history of complex package management systems and we don't currently well support compilres that are written in python.

The computer that creates the venv will not be the same one that executes the compilers, so a lot of system dependencies could change.

Unfortunately we don't have a great solution for this currently.

If you have Discord you could dro pinto our discord server for a chat about this, we're open to ideas. But python's installation system is a little hostile to our current setup as it stands.

- python3 -m venv venv
- source venv/bin/activate
- cd python
- TRITON_BUILD_WITH_CLANG_LLD=true TRITON_PLUGIN_DIRS=/opt/compiler-explorer/triton-shared-main pip install -e .
Copy link
Member

Choose a reason for hiding this comment

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

This will build on our "admin" installer node, which isn't a great place for this to go. In other languages we try and build a "hermetic", relocatable tarball that we use as the source of truth.

From (bitter) experience in my day job, python and its various virtual environments aren't great at this kind of thing. pip and poetry don't handle native dependencies at all, conda is not relocatable.

Also hardcoding /opt/compiler-explorer here is not a great idea as we support other installation locations (though pragmatically this will work for the CE main install)

@parsifal-47
Copy link
Author

Hi! sorry it's bad news here -- supporting compilers written in python hasn't been very easy for us to support in the past, and I think you're falling foul of that here.

Got it, let me think and get back to you on discord, maybe I could find a way to have less python, thank you for the review!

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.

2 participants