Rework plugin/PJRT wheel build to use Bazel Build#328
Open
lucbruni-amd wants to merge 1 commit intomasterfrom
Open
Rework plugin/PJRT wheel build to use Bazel Build#328lucbruni-amd wants to merge 1 commit intomasterfrom
lucbruni-amd wants to merge 1 commit intomasterfrom
Conversation
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.
Motivation
Addresses #175
Fixes #178 (the first half of which)
Technical Details
Use
bazel buildfor plugin/PJRT wheels and copy built artifacts frombazel-binto--output_path(nobazel runscript args).Add
copy_individual_filesandcopy_dir_recursivelyinbuild/tools/utils.pyfor copying.whlfiles and editable directory trees.Add
WHEEL_BAZEL_DIST_DIRandWHEEL_GLOB_PREFIXinbuild.pyand a copy step that uses them after the build.Add
WHEEL_BUILD_TARGET_EDITABLE_DICTand make the copy step usecopy_dir_recursivelyfor editable andcopy_individual_filesfor normal wheels.Split plugin sources into
ROCM_PLUGIN_STATIC_SRCSandROCM_PLUGIN_SOURCES; addbuild_gpu_kernels_wheel_via_sources(no data) and point the pluginjax_wheelat it.In
wheel_sourcesfor the plugin, usedata_srcsandpy_srcsfor@jaxROCm targets so the aspect collects.sofiles; keepstatic_srcsfor non-@jaxfiles.Add
jax_rocm7_plugin_wheel_editableandjax_rocm7_pjrt_wheel_editablejax_wheeltargets.In
build_gpu_kernels_wheel.py, add_find_patchelf()and use the resolved path when callingpatchelf; copy.sofrom--srcswhen present with fallback to runfiles and a clear errorSet default wheel type to release via
--repo_env=ML_WHEEL_TYPE=release(still overridable with--bazel_options=--repo_env=ML_WHEEL_TYPE=snapshot, for example). This addresses the second clause under Motivation above.Test Plan
Run the
build/ci_buildscript; runbuild/build.pydirectly with prefetching separated and combined with the build step; build editable wheels as previousTest Result
Observe expected wheelhouse/dist output wheels for the given test. Also observe that
bazel buildis supported allowing for prefetch + build separation.Submission Checklist