diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..887a2c1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# SCM syntax highlighting & preventing 3-way merges +pixi.lock merge=binary linguist-language=YAML linguist-generated=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44f272d --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/git/ +/.zed/ + + +# pixi environments +.pixi +*.egg-info +pixi.lock diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..2e15e83 --- /dev/null +++ b/pixi.toml @@ -0,0 +1,106 @@ +[workspace] +authors = ["Hameer Abbasi <2190658+hameerabbasi@users.noreply.github.com>"] +channels = ["conda-forge"] +name = "pytorch-dev" +platforms = ["linux-64", "osx-arm64"] +version = "0.1.0" + +[tasks] +build-core = { cmd = "./pytorch-build.sh", cwd = "." } +build-all = { cmd = "./torch-build.sh", cwd = "." } +update = { cmd = "./torch-update.sh", cwd = "." } +clone = { cmd = "./torch-clone.sh", cwd = "." } + +[activation.env] +PYTORCH_BUILD_DIRECTORY = "${PIXI_PROJECT_ROOT}/git" +PYTORCH_PIXI_BUILD = "1" + +[activation] +scripts = ["./torch-common.sh"] + +[feature.freethreading.dependencies] +python = "3.13.*" +python-freethreading = "3.13.*" + +[dependencies] +python = "3.9.*" + +[target.linux-64.dependencies] +# These three don't have free-threading support +lldb = "*" +gdb = "*" +halide-python = "*" + +[feature.core.dependencies] +pip = "*" +cpython = "*" +cmake = ">=3.27" +ninja = "*" +numpy = "*" +packaging = "*" +pkg-config = "*" +libuv = "*" +pyyaml = "*" +requests = "*" +six = "*" +typing-extensions = ">=4.10.0" +ccache = "*" +scikit-build = "*" +setuptools = ">=70.1.0,<80.0a0" +wheel = "*" +fsspec = "*" +types-dataclasses = "*" +expecttest = "*" +hypothesis = "*" +lintrunner = "*" +scipy = "*" +psutil = "*" +pytest = "*" +ghstack = "*" +ipython = "*" +pytest-sugar = "*" +pytest-xdist = "*" +filelock = "*" +sympy = "*" +astunparse = "*" +dill = "*" +jinja2 = "*" +lark = "*" +optree = "*" +tabulate = "*" +networkx = "*" +zlib = "*" +parameterized = "*" +libglib = "*" +pango = "*" +pillow = "*" + +[feature.core.target.linux-64.dependencies] +gcc = "13.*" +gxx = "13.*" +clang = "*" +clangxx = "*" +magma = "*" +cuda-driver-dev = "*" +cuda-version = "12.6.*" +cudnn = "*" +conda-gcc-specs = "*" +cuda-libraries-dev = "*" +cuda-nvcc = "*" +cuda-gdb = "*" +cuda-nvtx-dev = "*" +cuda-nvml-dev = "*" +cuda-cupti-dev = "*" +mkl = "*" +mkl-include = "*" +sysroot_linux-64 = ">=2.17" + +[feature.core.pypi-dependencies] +z3-solver = "*" + +[environments] +default = ["default", "core"] +freethreading = { features = [ + "freethreading", + "core", +], no-default-feature = true } diff --git a/pytorch-build.sh b/pytorch-build.sh index 684d8b2..e92be80 100755 --- a/pytorch-build.sh +++ b/pytorch-build.sh @@ -3,8 +3,10 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -eval "$(conda shell.bash hook)" -conda activate ${PYTORCH_CONDA_ENV:=pytorch-dev$PYTORCH_BUILD_SUFFIX} +if ${PYTORCH_PIXI_BUILD:-0} -eq 0; then + eval "$(conda shell.bash hook)" + conda activate ${PYTORCH_CONDA_ENV:=pytorch-dev$PYTORCH_BUILD_SUFFIX} +fi cd ${PYTORCH_BUILD_DIRECTORY:=~/git$PYTORCH_BUILD_SUFFIX}/pytorch source $SCRIPT_DIR/torch-common.sh diff --git a/torch-env.sh b/torch-env.sh index 5c3b5d6..346e4bf 100755 --- a/torch-env.sh +++ b/torch-env.sh @@ -2,13 +2,13 @@ set -e SCRIPT_DIR=$( pushd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -conda env create \ - -f $SCRIPT_DIR/pytorch-dev.yaml \ - -n ${PYTORCH_CONDA_ENV:=pytorch-dev$PYTORCH_BUILD_SUFFIX} - -conda activate ${PYTORCH_CONDA_ENV:=pytorch-dev${PYTORCH_BUILD_SUFFIX}} -echo "source $SCRIPT_DIR/torch-common.sh" > $CONDA_PREFIX/etc/conda/activate.d/activate-torch.sh -echo "source $SCRIPT_DIR/deactivate-torch-common.sh" > $CONDA_PREFIX/etc/conda/activate.d/deactivate-torch.sh +if ${PYTORCH_PIXI_BUILD:-0} -eq 0; then + conda env create \ + -f $SCRIPT_DIR/pytorch-dev.yaml \ + -n ${PYTORCH_CONDA_ENV:=pytorch-dev$PYTORCH_BUILD_SUFFIX} + conda activate ${PYTORCH_CONDA_ENV:=pytorch-dev${PYTORCH_BUILD_SUFFIX}} + echo "source $SCRIPT_DIR/torch-common.sh" > $CONDA_PREFIX/etc/conda/activate.d/activate-torch.sh + echo "source $SCRIPT_DIR/deactivate-torch-common.sh" > $CONDA_PREFIX/etc/conda/activate.d/deactivate-torch.sh +fi popd