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

python311Packages.{jax,jaxlib,jaxlib-bin}: 0.4.28 -> 0.4.32 #318995

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GaetanLepage
Copy link
Contributor

@GaetanLepage GaetanLepage commented Jun 11, 2024

Description of changes

Changelogs:

cc @samuela

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@GaetanLepage
Copy link
Contributor Author

I cannot get jaxlib to build:

Analyzing: 2 targets (46 packages loaded, 225 targets configured)
INFO: Repository pypi_setuptools instantiated at:
  /build/source/WORKSPACE:27:13: in <toplevel>
  /build/output/external/pypi/requirements.bzl:49:20: in install_deps
Repository rule whl_library defined at:
  /build/output/external/rules_python/python/pip_install/pip_repository.bzl:697:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'pypi_setuptools':
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/pip_install/pip_repository.bzl", line 596, column 13, in _whl_library_impl
                fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code))
Error in fail: whl_library pypi_setuptools failed:  (src/main/tools/process-wrapper-legacy.cc:80: "execvp(/build/output/external/python_x86_64-unknown-linux-gnu/bin/python3, ...)": >
) error code: '1'
ERROR: /build/source/WORKSPACE:27:13: fetching whl_library rule //external:pypi_setuptools: Traceback (most recent call last):
        File "/build/output/external/rules_python/python/pip_install/pip_repository.bzl", line 596, column 13, in _whl_library_impl
                fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code))
Error in fail: whl_library pypi_setuptools failed:  (src/main/tools/process-wrapper-legacy.cc:80: "execvp(/build/output/external/python_x86_64-unknown-linux-gnu/bin/python3, ...)": >
) error code: '1'
ERROR: /build/source/jaxlib/tools/BUILD.bazel:25:10: //jaxlib/tools:build_wheel depends on @pypi_setuptools//:pkg in repository @pypi_setuptools which failed to fetch. no such packa>
) error code: '1'
ERROR: Analysis of target '//jaxlib/tools:build_wheel' failed; build aborted: Analysis failed
INFO: Elapsed time: 38.193s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (46 packages loaded, 225 targets configured)

@GaetanLepage
Copy link
Contributor Author

I cannot get jaxlib to build:

Could be due to this change: jax-ml/jax@jaxlib-v0.4.28...jaxlib-v0.4.29#diff-5493ff8e9397811510e780de47c57abb70137f1afe85d1519130dc3679d60ce5

@GaetanLepage GaetanLepage changed the title python311Packages.{jax,jaxlib,jaxlib-bin}: 0.4.28 -> 0.4.29 python311Packages.{jax,jaxlib,jaxlib-bin}: 0.4.28 -> 0.4.30 Jun 18, 2024
@GaetanLepage
Copy link
Contributor Author

I updated to v0.4.30 which was released today.

However, it crashes in a different way:

Running phase: unpackPhase
unpacking source archive /nix/store/sbky7hcqq756a9vyg7g76nq5l9z4wsz4-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
Extracting Bazel installation...
WARNING: The following configs were expanded more than once: [mkl_open_source_only]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=0
INFO: Reading rc options for 'build' from /build/source/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /nix/store/62azw4ysqscs49zybmbdl21yh1yra7s2-bazel-rc:
  'build' options: --distdir=/nix/store/c74pr6dwc94w8aynj631xkna5gvmg20c-bazel-deps --extra_toolchains=@bazel_tools//tools/jdk:nonprebuilt_toolchain_definition --tool_java_runtime_version=local_jdk_11 --java_runtime_version=local_jdk_11
INFO: Reading rc options for 'build' from /build/source/.bazelrc:
  'build' options: --nocheck_visibility --apple_platform_type=macos --macos_minimum_os=10.14 --announce_rc --define open_source_build=true --spawn_strategy=standalone --enable_platform_specific_config --experimental_cc_shared_library --define=no_aws_support=true --define=no_gcp_support=true --define=no_hdfs_support=true --define=no_kafka_support=true --define=no_ignite_support=true --define=grpc_no_ares=true --define=tsl_link_protobuf=true -c opt --config=short_logs --copt=-DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir. --@xla//xla/python:enable_gpu=false
INFO: Reading rc options for 'build' from /build/source/.jax_configure.bazelrc:
  'build' options: --strategy=Genrule=standalone --repo_env PYTHON_BIN_PATH=/nix/store/6b1fqdwb3g56j5pazv8zkx9qd0mv3wiz-python3-3.11.9/bin/python --action_env=PYENV_ROOT --python_path=/nix/store/6b1fqdwb3g56j5pazv8zkx9qd0mv3wiz-python3-3.11.9/bin/python --distinct_host_configuration=false --define PROTOBUF_INCLUDE_PATH=/nix/store/bhr113ijfjij5z3l8h0dzxd0836647wc-protobuf-25.3/include --config=mkl_open_source_only
INFO: Found applicable config definition build:short_logs in file /build/source/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:mkl_open_source_only in file /build/source/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:avx_posix in file /build/source/.bazelrc: --copt=-mavx --host_copt=-mavx
INFO: Found applicable config definition build:mkl_open_source_only in file /build/source/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:linux in file /build/source/.bazelrc: --config=posix --copt=-Wno-unknown-warning-option --copt=-Wno-stringop-truncation --copt=-Wno-array-parameter
INFO: Found applicable config definition build:posix in file /build/source/.bazelrc: --copt=-fvisibility=hidden --copt=-Wno-sign-compare --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
Loading: 
Loading: 
DEBUG: /build/output/external/xla/third_party/py/python_repo.bzl:99:14: 
HERMETIC_PYTHON_VERSION variable was not set correctly, using default version.
Python 3.11 will be used.
To select Python version, either set HERMETIC_PYTHON_VERSION env variable in
your shell:
  export HERMETIC_PYTHON_VERSION=3.12
OR pass it as an argument to bazel command directly or inside your .bazelrc
file:
  --repo_env=HERMETIC_PYTHON_VERSION=3.12
DEBUG: /build/output/external/xla/third_party/py/python_repo.bzl:110:10: Using hermetic Python 3.11
Loading: 
INFO: Repository python_x86_64-unknown-linux-gnu instantiated at:
  /build/source/WORKSPACE:24:23: in <toplevel>
  /build/output/external/xla/third_party/py/python_init_toolchains.bzl:9:35: in python_init_toolchains
  /build/output/external/rules_python/python/repositories.bzl:580:26: in python_register_toolchains
Repository rule python_repository defined at:
  /build/output/external/rules_python/python/repositories.bzl:404:36: in <toplevel>
java.util.logging.ErrorManager: 1
java.io.IOException: No space left on device
        at java.base/java.io.FileOutputStream.writeBytes(Native Method)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
Loading: 
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
Loading: 
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
Loading: 
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
Loading: 
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        at java.base/java.io.FileOutputStream.write(FileOutputStream.java:354)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>
        File "/build/output/external/rules_python/python/repositories.bzl", line 175, column 34, in _python_repository_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz to /build/output/external/python_x86_64-unknown-linux-gnu/temp12096015298234464535: write (No space left on device)
Loading: 
        at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:52)        at java.base/sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233)        at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:303) at java.base/sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281) at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)     at java.base/sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)     at java.base/java.io.OutputStreamWriter.write(OutputStreamWriter.java:226)      at java.base/java.io.Writer.write(Writer.java:249)      at com.google.devtools.build.lib.util.SimpleLogHandler$Output.write(SimpleLogHandler.java:765)  at com.google.devtools.build.lib.util.SimpleLogHandler.publish(SimpleLogHandler.java:434)       at java.logging/java.util.logging.Logger.log(Logger.java:979>

@GaetanLepage
Copy link
Contributor Author

The diff looks non-trivial: jax-ml/jax@jaxlib-v0.4.29...jaxlib-v0.4.30
jax seems to now depend directly on jaxlib: https://jax.readthedocs.io/en/latest/changelog.html#jax-0-4-30-june-18-2024

Comment on lines 377 to 388
{ x86_64-linux = ""; }
else
{
x86_64-linux = "sha256-uOoAyMBLHPX6jzdN43b5wZV5eW0yI8sCDD7BSX2h4oQ=";
aarch64-linux = "sha256-+SnGKY9LIT1Qhu/x6Uh7sHRaAEjlc//qyKj1m4t16PA=";
x86_64-linux = "";
aarch64-linux = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this normal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a WIP. I am stuck on #318995 (comment).

I will mark this PR as draft.

@GaetanLepage GaetanLepage marked this pull request as draft June 26, 2024 07:01
@samuela
Copy link
Member

samuela commented Jun 26, 2024

However, it crashes in a different way:

It looks like it has just run out of disk space, eg write (No space left on device)

@GaetanLepage
Copy link
Contributor Author

It looks like it has just run out of disk space, eg write (No space left on device)

I'm afraid that there is a real issue unfortunately:

Analyzing: 2 targets (45 packages loaded, 225 targets configured)
INFO: Repository pypi_build instantiated at:
  /build/source/WORKSPACE:30:13: in <toplevel>
  /build/output/external/pypi/requirements.bzl:49:20: in install_deps
Repository rule whl_library defined at:
  /build/output/external/rules_python/python/pip_install/pip_repository.bzl:697:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'pypi_build':
   Traceback (most recent call last):
        File "/build/output/external/rules_python/python/pip_install/pip_repository.bzl", line 596, column 13, in _whl_library_impl
                fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code))
Error in fail: whl_library pypi_build failed:  (src/main/tools/process-wrapper-legacy.cc:80: "execvp(/build/output/external/python_x86_64-unknown-linux-gnu/bin/python3, ...)": No su>
) error code: '1'
ERROR: /build/source/WORKSPACE:30:13: fetching whl_library rule //external:pypi_build: Traceback (most recent call last):
        File "/build/output/external/rules_python/python/pip_install/pip_repository.bzl", line 596, column 13, in _whl_library_impl
                fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code))
Error in fail: whl_library pypi_build failed:  (src/main/tools/process-wrapper-legacy.cc:80: "execvp(/build/output/external/python_x86_64-unknown-linux-gnu/bin/python3, ...)": No su>
) error code: '1'
ERROR: /build/source/jaxlib/tools/BUILD.bazel:25:10: //jaxlib/tools:build_wheel depends on @pypi_build//:pkg in repository @pypi_build which failed to fetch. no such package '@pypi_>
) error code: '1'
ERROR: Analysis of target '//jaxlib/tools:build_wheel' failed; build aborted: Analysis failed
INFO: Elapsed time: 39.451s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (45 packages loaded, 225 targets configured)

@drupol
Copy link
Contributor

drupol commented Jun 28, 2024

what's the status of this?

@GaetanLepage
Copy link
Contributor Author

what's the status of this?

I'm stuck on this. We need to revisit the jaxlib derivation regarding the breaking changes introduced in this release.

@SomeoneSerge
Copy link
Contributor

SomeoneSerge commented Jul 1, 2024

From a quick glance, I think jaxlib and tensorflow broke with this change: jax-ml/jax@517e299. I think this forces bazel to download a "hermetic" python which is basically some prebuilt binary of questionable origin. Looking at the build logs, it also chooses the python release "automatically" unless you export HERMETIC_PYTHON_VERSION. We want this feature off, random executables from the internet is not the kind of reproducibility Nixpkgs is after...

Tracking upstream: jax-ml/jax#22216 (comment)

@GaetanLepage can you try fetchpatch { ...; revert = true; }?

@vam-google
Copy link

vam-google commented Jul 1, 2024

Hello @SomeoneSerge,

We are sorry to hear that hermetic Python setup breaks your workflow . I would like to learn more about it, specifically if it is a technical breakage or more in the realm of depending on downloaded python being against your established policies.

Either way, your issues could be solved without non-hermetic behavior (please check my response in jax/issues/22216 for details).

Let me to address a few of the raised concerns directly in this thread

random executables from the internet

The downloaded Python interpreters are not of questionable origin and are not random at all. The actual packages to download, together with their SHA256 sums are specified directly in rules_python, which is an officially supported product. If you trust bazel to build your project (which must be the case here) you should trust rules_python as one of its core components as well. The actual python binaries used are based on https://github.com/indygreg/python-build-standalone, if that does not satisfy your standards, you may always provide your own python interpreter and exactly that one will be used in your build.

is not the kind of reproducibility Nixpkgs is after

I would like to know more about how reproducibility is defined in Nixpkgs, but either way one of hermetic Python's major goals is to actually increase reproducibility. Hermetic Python locks all of the key dependencies together with their SHA256 sums, so entire Python ecosystem in the build is fully locked and remains the same regardless of the surrounding environment and depends only on the corresponnding git commit which updates/changes those dependencies directly in the source tree.

Downloading anything from the internet in general.
One way or another any bazel build always downloads lost and lots of dependencies form the internet every time. Those dependencies are always specified with corresponding SHA256 sums, which should reduce the probability of any malicious attack. The fact of downloading the same thing every time regardless of the actual environment is explicitly designed to ensure reprehensibility of every build, not to make it worse. It is a cornerstone of bazel's design, and you should use bazel only if that is acceptable for your case. Python was just one of the few inconsistent with that paradigm parts of the dependency resolution mechanism which we are finally cleaning up here.

@GaetanLepage
Copy link
Contributor Author

Hello @SomeoneSerge,

We are sorry to hear that hermetic Python setup breaks your workflow . I would like to learn more about it, specifically if it is a technical breakage or more in the realm of depending on downloaded python being against your established policies.

Either way, your issues could be solved without non-hermetic behavior (please check my response in jax/issues/22216 for details).

Let me to address a few of the raised concerns directly in this thread

random executables from the internet

The downloaded Python interpreters are not of questionable origin and are not random at all. The actual packages to download, together with their SHA256 sums are specified directly in rules_python, which is an officially supported product. If you trust bazel to build your project (which must be the case here) you should trust rules_python as one of its core components as well. The actual python binaries used are based on https://github.com/indygreg/python-build-standalone, if that does not satisfy your standards, you may always provide your own python interpreter and exactly that one will be used in your build.

is not the kind of reproducibility Nixpkgs is after

I would like to know more about how reproducibility is defined in Nixpkgs, but either way one of hermetic Python's major goals is to actually increase reproducibility. Hermetic Python locks all of the key dependencies together with their SHA256 sums, so entire Python ecosystem in the build is fully locked and remains the same regardless of the surrounding environment and depends only on the corresponnding git commit which updates/changes those dependencies directly in the source tree.

Downloading anything from the internet in general. One way or another any bazel build always downloads lost and lots of dependencies form the internet every time. Those dependencies are always specified with corresponding SHA256 sums, which should reduce the probability of any malicious attack. The fact of downloading the same thing every time regardless of the actual environment is explicitly designed to ensure reprehensibility of every build, not to make it worse. It is a cornerstone of bazel's design, and you should use bazel only if that is acceptable for your case. Python was just one of the few inconsistent with that paradigm parts of the dependency resolution mechanism which we are finally cleaning up here.

Thank you @vam-google for this very detailed answer.
Indeed, it is quite challenging (well impossible) for nix derivation to implicitly fetch some resources from the internet at build time. Nix is adopting a similar strategy as what you described regarding rules_python. The issue here is that we can't satisfy both build systems simultaneously.
I think that the most sensible option for us is to provide bazel with our own python interpreter and dependencies.
The goal for us is now to find a way around those restrictions in order to successfully build jaxlib from source.

The answer to @SomeoneSerge's issue looks like a good starting point !

@samuela
Copy link
Member

samuela commented Jul 1, 2024

Thanks @vam-google for providing this info!

I would like to know more about how reproducibility is defined in Nixpkgs, but either way one of hermetic Python's major goals is to actually increase reproducibility.

Nix has two types of build rules, called "derivations" in Nix parlance:

  1. Normal derivations, the default: All inputs are pinned/fixed according to their hashes, and the build script itself is pinned according to its hash. The build environment restricts certain kinds of naughty behavior -- eg network access -- to promote stability in the final result. Example: most Nix package builds.
  2. Fixed-output derivations (FODs): These derivations are based on a pinned build script, but are executed in an unrestricted environment, so eg network access is fair game. Buuuuut the hash of the output is specified at compile time and verified. Example: fetchFromGitHub.

Our Bazel rule, buildBazelPackage, works by splitting the build into two Nix derivations: a fixed-output derivation for bazel fetch, and a normal derivation for bazel build.

Btw I will shamelessly take this opportunity to draw your attention to #321920 in which we have found that the output of the bazel fetch step is actually not reproducible. Different users are seeing different hashes (#296737). I believe that we have fixed this with #323681 (s/o to @SomeoneSerge!), but I'd be curious to hear your thoughts on this since it seems to violate Bazel's claims to reproducibility. Perhaps we're missing something?

@SomeoneSerge
Copy link
Contributor

Thanks and welcome @vam-google! I'll try to be brief (EDIT: I failed) and not parrot what has already been said.

Regarding "our workflow", my response1 in the jax repo touches on the subject a bit. What I didn't mention is parallel goals such as customization, inspectability, etc. There's some benefits we get from being able to make all of our software use exactly the same python interpreter arbitrarily customized at the user site. <HERE WAS A CHUNK OF TEXT REPEATING SAMUEL'S POST IN DIFFERENT WORDS>

The removed piece:

As Gaetan mentions, Bazel and Nix take on some of the same responsibilities. As Samuel says, Nix only really implements two concepts: an immutable "store", and the singular way to extend the store, using programs that convert a pre-defined set of inputs into a pre-defined set of outputs. These are run in isolation to ensure that no other inputs can be read and no other outputs can be written; this all of course must sound very familiar and resembling "Bazel ignoring <...> the actual environment". Maybe to emphasize the differences instead, neither Nix nor Nixpkgs have anything like cc_library or cc_executable: at this level of detail we just delegate to tools like meson and cmake, and rely on the sandbox. In this sense Nix is a subset of Bazel, but this is often a positive: e.g. a project that uses Nix as a development tool will likely use cmake/meson exactly the same way it would without Nix, and so is easier to consume in other environments.

(end of the removed piece)

to know ...if it is a technical breakage or more in the realm of ... policies

I'd say it's both. I highlighted some of the technical aspects in the other response1, although I think that was just the first iteration. As for the policies, this has to do with your other question:

...more in the realm of ... policies? <...> ...how reproducibility is defined in Nixpkgs?

Some of our "derivations" are actually non-deterministic (parallelism, scheduling, etc) so it's more common that we'd talk about "repeatability"... but to really answer your question, I'd rather think in terms of "complexity" instead. In particular, the cost we must pay now to be able to bootstrap a piece of today's software from scratch, say, ten years later. In the first approximation (let's say, compatible hardware and such belong in the 0th), our main threat are these "FODs" that Samuel has mentioned, for two reasons: many of them are the roots of our dependency DAG (and all roots are FODs), and they also are impure (allowed network). Thus at the very least, one had better archived all of the FODs. Thus, we want fewer and smaller FODs. From this point of view, having a piece of source code as a root is preferable (less "complex") to having a collection of large non-inspectable platform-specific binaries. Our ideal would be a full-source bootstrap similar to what Guix does2, but there are tradeoffs involved and we currently make different choices.

It was also in this limited sense that I called the downloaded binaries "questionable [in] origin" and "random"

Footnotes

  1. https://github.com/google/jax/issues/22216#issuecomment-2201499630 2

  2. https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 4, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 30, 2024
@GaetanLepage GaetanLepage force-pushed the jax branch 4 times, most recently from c8f4e2a to 9754cfa Compare August 25, 2024 09:42
@GaetanLepage GaetanLepage changed the title python311Packages.{jax,jaxlib,jaxlib-bin}: 0.4.28 -> 0.4.30 python311Packages.{jax,jaxlib,jaxlib-bin}: 0.4.28 -> 0.4.32 Sep 13, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 27, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 23, 2024
@mweinelt
Copy link
Member

Head's up: We're migrating to numpy 2.1 in #354627 and jax 0.4.28 is failing a number of tests on 3.12 and 3.13.

FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUnique1 - AssertionError: Tuples differ: (3,) != (3, 1)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUnique2 - AssertionError: Tuples differ: (2,) != (2, 1, 1)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUnique4 - AssertionError: Tuples differ: (3,) != (3, 1)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize0 - AssertionError: Tuples differ: (4,) != (1, 4)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize4 - AssertionError: Tuples differ: (4,) != (1, 4)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize5 - AssertionError: Tuples differ: (1,) != (1, 1)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize6 - AssertionError: Tuples differ: (3,) != (3, 1)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize8 - AssertionError: Tuples differ: (4,) != (1, 1, 4)
FAILED tests/lax_numpy_test.py::LaxBackedNumpyTests::testUniqueSize9 - AssertionError: Tuples differ: (3,) != (3, 1)
FAILED tests/lax_numpy_test.py::NumpySignaturesTest::testWrappedSignaturesMatch - AssertionError: {'clip': {'np_params': ['a', 'a_min', 'a_max', 'min', 'max'...
FAILED tests/lax_numpy_reducers_test.py::JaxNumpyReducerTests::testCumulativeSum0 - AssertionError:

@samuela
Copy link
Member

samuela commented Nov 17, 2024

Thanks for the heads up @mweinelt!

Has anyone tried the suggestion in jax-ml/jax#22216 (comment) yet? If so, what was the result?

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants