Fix mlx.launch --python: flag is parsed but never forwarded to the launch script - #4002
Merged
Merged
Conversation
Since ml-explore#3536 removed automatic interpreter prepending, the --python flag (help: 'Use this python on the remote hosts') has been accepted and silently ignored: RemoteProcess receives the python argument but never passes it to make_launch_script, so the launched command is always exec'd verbatim. Keep the no-automatic-prepending default, but honor the flag when it is explicitly provided by prepending the requested interpreter to the command. --print-python still reports sys.executable when the flag is unset.
zcbenz
force-pushed
the
fix/launch-python-flag
branch
from
August 6, 2026 00:54
d2a1857 to
4965266
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
mlx.launch --pythonis documented and parsed, but has no effect: #3536 removed automatic interpreter prepending and added the flag for users who still need it, butRemoteProcessnever forwards it tomake_launch_script, so the launched command always runs without an interpreter prefix on the remote side.This threads the flag through
RemoteProcess→make_launch_script. The no-prepend default from #3536 is unchanged; an explicit--pythonis now honored.Checklist
black/isorton the touched Python files (clean; no C++ touched)python/tests/test_launch.py) covering the default no-prepend path, an explicit--python, and interpreter-path handling