-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add a CPU lowering pass #1
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when i ran this locally there's a warning from Python using is
operator in this situation. I'm definitely not Python programmer but i think the correct code you want might be something more like this:
def _get_triton_shared_opt_path():
path = os.getenv("TRITON_SHARED_OPT_PATH", "")
if path == "":
raise Exception("TRITON_SHARED_OPT_PATH is not set.")
return path
def _get_llvm_bin_path(bin_name: str):
path = os.getenv("LLVM_BINARY_DIR", "")
if path == "":
raise Exception("LLVM_BINARY_DIR is not set.")
return f"{path}/{bin_name}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I don't remember why I used is
, but I fixed the issue in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep gettting this error on latest version on triton which odd since Intel's XPU backend does the same thing
/triton/python/triton/third_party/cpu/__init__.py", line 13, in <module>
from triton.runtime.jit import version_key # noqa:E402
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'version_key' from 'triton.runtime.jit'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danikhan632 i'm pretty sure there's some kind of versioning mismatch going on as the code around this changed recently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at this PR!
- From a reproducibility perspective, it worked at least on GitHub Actions below, so if you follow exactly the same way as what it does, it should work.
- If you are using the very latest Triton (not the version specified by ".github/workflows/integration-tests.yml"), maybe the upstream has reorganized files and function names etc. I will investigate it when the version is updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was working on a similar thing, do you plan on making the compiler with gcc/clang?
worked on the intel extenison so most of my experience building a launcher comes from that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might not fully understand your question, but this PR uses the following binaries.
- Triton's default LLVM binaries (llc and mlir-opt)
- The default C++ compiler for the pybind logic and linking etc; now it uses
g++
(hardcoded, but can be changed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which triton commit hash are you using?s till running into the same issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See .github/workflows/integration-tests.yml
. It uses 05dc28be0e72dd496300a31b99a21a5a5118f8e9.
Please also check the installation method written in the GitHub Action script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed that, thank you
This demonstrates how
triton-shared
can potentially run its lowered linalg + its friends on CPU as a reference.triton-shared
generated code (it causes SEGV).Recently Triton updated its test suite to specify the device type iirc, so we can naturally run
test_core.py
using a reference CPU backend if the problem above will be solved. Would it be something interesting?