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

_path_to_binary is not safe for file paths with spaces. (RuntimeError: Cannot find ptxas) #3305

Closed
nbarlowportfolio opened this issue Mar 7, 2024 · 2 comments

Comments

@nbarlowportfolio
Copy link

In file python/triton/backends/compiler.py, the function _path_to_binary() splits on space, which prevents paths containing spaces from working.

    for p in paths:
        bin = p.split(" ")[0]  # Bug! If there are spaces in the path to your ipynb, you will have a bad time.
        bin = p
@jlebar
Copy link
Collaborator

jlebar commented Mar 7, 2024

I agree this is a bug. Patches welcome.

@nbarlowportfolio nbarlowportfolio changed the title _path_to_binary is not safe for file paths with spaces. _path_to_binary is not safe for file paths with spaces. (RuntimeError: Cannot find ptxas) Mar 7, 2024
fkouteib added a commit to fkouteib/triton that referenced this issue Mar 24, 2024
call to split() on a file path string results in a truncated path if the latter has spaces in it, then the target binary is not found. It was an unnecessary step.
jlebar pushed a commit that referenced this issue Mar 25, 2024
A call to split() on a file path string results in a truncated path if
the latter has spaces in it, then the target binary is not found. It was
an unnecessary step.
@fkouteib
Copy link
Contributor

@nbarlowportfolio the bug fix is merged to master. But you'd have to build from source to use it since nightly wheels build has been down for a few weeks. Note that the fix was applied to 'third_party/nvidia/backend/compiler.py' not 'python/triton/backends/compiler.py' since the former is the instance of the impacted method that's actually used. 'python/triton/backends/compiler.py' is listed in the project's .gitignore file. So I didn't bother patching the same method there.

@jlebar jlebar closed this as completed Mar 29, 2024
karupayun pushed a commit to openxla/triton that referenced this issue Apr 3, 2024
A call to split() on a file path string results in a truncated path if
the latter has spaces in it, then the target binary is not found. It was
an unnecessary step.
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

No branches or pull requests

3 participants