Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Arech8
Copy link
Contributor

@Arech8 Arech8 commented Sep 12, 2025

Motivation

bd2fab3 introduced a regression that disabled checking out ./xla directory by default. This PR fixes it.

Additionally the PR:

  • adds --target_cpu_features=native to build/build.py calls in the Makefile to produce more optimal dev build faster
  • renames XLA_OVERRIDE_OPTION makefile variable to a more generic ALL_BAZEL_OPTIONS to better reflect the scope and the purpose of the variable.
  • adds refresh and refresh_jaxlib rules as shortcuts to corresponging clean dist install rules.
  • adds --fix-bazel-symbols option to stack.py. This lets the script assumes you need to build code in a release with symbolic info configuration to alleviate debugging. The script enables respective bazel options and adds ./external symbolic links to corresponding workspaces pointing to bazel's dependencies storage.
  • documents for the changes

@Arech8 Arech8 requested a review from a team September 12, 2025 08:20
@Arech8 Arech8 changed the title Bugfix stack.py to re-enable ./xla checkout Bugfix stack.py to re-enable ./xla checkout, +improvements for the Makefile template Sep 12, 2025
Copy link
Contributor

@Ruturaj4 Ruturaj4 left a comment

Choose a reason for hiding this comment

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

LGTM

@Arech8 Arech8 changed the title Bugfix stack.py to re-enable ./xla checkout, +improvements for the Makefile template Bugfix stack.py to re-enable ./xla checkout, +improvements Sep 12, 2025
/jax

# temporary working files
/_my
Copy link
Contributor

Choose a reason for hiding this comment

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

what generates this _my folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing generates it, I just use it for work scripts and tired of adding it to a local .gitignore on each new checkout.
It's good to have a dedicated dir for such stuff, dumps and whatnot...

# pylint: disable=line-too-long
assert os.path.isdir(
kernels_jax_path
), f"XLA path (specified as '{kernels_jax_dir}') doesn't resolve to existing directory at '{kernels_jax_path}'"
Copy link
Contributor

Choose a reason for hiding this comment

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

I am confused about this "kernels_jax_dir" variable. Could you please put detailed explanation for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kernels_jax_dir is the var created by Charles in his previous PR. Essentially it's a directory for the JAX parts, such as kernels, that are needed for pjrt & plugin compilation. It might and might not coincide with ./jax tests directory. Before Charles's PR ./jax was just an independent test storage, and kernels were always taken from the upsteam jax-ml/jax. In his PR, he added an override to always use ./jax (more properly the value of --kernel-jax-dir argument if is set) instead of the upstream, so it's finally used to build pjrt&plugin where it's needed. Now, the upstream jax-ml/jax is used only if --kernel-jax-dir argument is explicitly set to an empty string.

kernels_jax_path is just an abspath(kernels_jax_dir). Absolute paths are mandatory to make debug info remapping work properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand, thanks for the detailed explanation!

Co-authored-by: Gulsum Gudukbay Akbulut <[email protected]>
Copy link
Contributor

@gulsumgudukbay gulsumgudukbay left a comment

Choose a reason for hiding this comment

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

Looks good!

python3 ./build/build.py build \
--use_clang=true \
--wheels=jax-rocm-plugin \
--target_cpu_features=native \
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea!

@Arech8 Arech8 merged commit 0df67d9 into master Sep 12, 2025
5 checks passed
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.

4 participants