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

[CI, enhancement] enable external oneDAL builds in build-and-test-lnx.yml Azure Pipelines #2125

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c1318ff
Update build-and-test-lnx.yml
icfaust Oct 22, 2024
aa42262
Update build-and-test-lnx.yml
icfaust Oct 22, 2024
2558b9d
Update build-and-test-lnx.yml
icfaust Oct 22, 2024
ed24588
Update build-and-test-lnx.yml
icfaust Oct 22, 2024
4be72c8
Update build.sh
icfaust Oct 23, 2024
97c7257
Update run_test.sh
icfaust Oct 23, 2024
30f5583
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
0391a2f
Update run_test.sh
icfaust Oct 23, 2024
a0c0634
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
fc34815
Update ci.yml
icfaust Oct 23, 2024
47e8e30
Update ci.yml
icfaust Oct 23, 2024
9e9ce4f
Update build.sh
icfaust Oct 23, 2024
5f2f414
Update build.sh
icfaust Oct 23, 2024
626a9c5
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
a75001e
Update run_test.sh
icfaust Oct 23, 2024
0492649
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
72f4ddb
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
d5ddbb1
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
98e6615
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
a777cb3
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
8bf074d
Update build-and-test-lnx.yml
icfaust Oct 23, 2024
ad94c40
Merge branch 'intel:main' into dev/azure_pipelines_without_dal-devel
icfaust Oct 24, 2024
19f88ab
Update build-and-test-lnx.yml
icfaust Oct 24, 2024
2b165c3
Merge branch 'intel:main' into dev/azure_pipelines_without_dal-devel
icfaust Oct 29, 2024
b9cf707
Merge branch 'intel:main' into dev/azure_pipelines_without_dal-devel
icfaust Oct 30, 2024
8929fc3
add TBBROOT and disable dpnp/dpctl by NO_DPC
icfaust Nov 1, 2024
069a3f1
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
bd939f9
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
163ffbc
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
6b1c7e4
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
ef4b81b
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
763c1e6
Update setup.py
icfaust Nov 1, 2024
e4c481d
Update setup.py
icfaust Nov 1, 2024
72adc22
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
b7b3b35
Update ci.yml
icfaust Nov 1, 2024
01354d9
Update ci.yml
icfaust Nov 1, 2024
01f2b31
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
6fe5e0f
Update build-and-test-lnx.yml
icfaust Nov 1, 2024
8af396c
Merge branch 'intel:main' into dev/azure_pipelines_without_dal-devel
icfaust Nov 1, 2024
38da718
Update build-and-test-lnx.yml
icfaust Nov 2, 2024
d57cf5d
Update build-and-test-lnx.yml
icfaust Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .ci/pipeline/build-and-test-lnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ steps:
displayName: "apt-get"
- script: |
bash .ci/scripts/install_dpcpp.sh
condition: and(eq(variables.NO_DPC, ''), eq(variables.DPCPPROOT, ''))
displayName: "dpcpp installation"
- script: |
source /opt/intel/oneapi/compiler/latest/env/vars.sh
Expand All @@ -27,47 +28,73 @@ steps:
conda config --add channels conda-forge
conda config --set channel_priority strict
conda update -y -q conda
conda create -q -y -n CB -c conda-forge python=$(PYTHON_VERSION) dal-devel mpich pyyaml "dpcpp-cpp-rt=2024.2.0"
conda create -q -y -n CB -c conda-forge python=$(PYTHON_VERSION) mpich pyyaml "dpcpp-cpp-rt=2024.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: would this switch all of these jobs to the external builds? I think it'd be quite useful to leave some with the stable release too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Very good question and suggestion. Why do we stop using stable version for building and testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will switch to external builds only if a DALROOT is specified, and example using it is here: oneapi-src/oneDAL#2950 which is the immediate use case. The question remains the same as when GitHub actions CI was introduced, do we eventually want to move toward using versions of oneDAL main branch rather than release branches?

Copy link
Contributor

@samir-nasibli samir-nasibli Nov 11, 2024

Choose a reason for hiding this comment

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

@icfaust I think it would be good to get @homksei @Alexsandruss @napetrov and @syakov-intel ’s opinions on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samir-nasibli Just as a note, there is a precedence within the conda-recipe for DPCPPROOT set outside of the conda-recipe: https://github.com/intel/scikit-learn-intelex/blob/main/conda-recipe/build.sh#L38

This work simply continues on that precedent.

Secondly, the core flow using stable versions for building and testing on azure pipelines CI is not changed. Dal-devel and oneapi components are still acquired from conda in azure pipelines.

displayName: "Conda create"
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
if [ -z "${DALROOT}" ]; then conda install -q -y -c conda-forge dal-devel; fi
pip install -r dependencies-dev
pip list
env:
DALROOT: ${{ variables.DALROOT }}
displayName: "Install develop requirements"
- script: |
export DPCPPROOT=/opt/intel/oneapi/compiler/latest
if [ -z "${DPCPPROOT}" ]; then export DPCPPROOT=/opt/intel/oneapi/compiler/latest; fi
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
export DALROOT=$CONDA_PREFIX
if [ -z "${DALROOT}" ]; then export DALROOT=$CONDA_PREFIX; fi
./conda-recipe/build.sh
env:
NO_DPC: ${{ variables.NO_DPC }}
NO_DIST: ${{ variables.NO_DIST }}
DPCPPROOT: ${{ variables.DPCPPROOT }}
DALROOT: ${{ variables.DALROOT }}
displayName: "Build daal4py/sklearnex"
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
bash .ci/scripts/setup_sklearn.sh $(SKLEARN_VERSION)
pip install --upgrade -r requirements-test.txt
pip install $(python .ci/scripts/get_compatible_scipy_version.py)
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.11') ] && [ $(SKLEARN_VERSION) != "1.0" ]; then conda install -q -y -c https://software.repos.intel.com/python/conda/ dpctl=0.17.0 dpnp=0.15.0; fi
if [ $(echo $(PYTHON_VERSION) | grep '3.9\|3.11') ] && [ $(SKLEARN_VERSION) != "1.0" ] && [ -z ${NO_DPC} ]; then conda install -q -y -c https://software.repos.intel.com/python/conda/ dpctl=0.17.0 dpnp=0.15.0; fi
pip list
env:
NO_DPC: ${{ variables.NO_DPC }}
displayName: "Install testing requirements"
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
cd ..
./s/conda-recipe/run_test.sh --json-report
env:
DALROOT: ${{ variables.DALROOT }}
TBBROOT: ${{ variables.TBBROOT }}
displayName: "Sklearnex testing"
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
bash .ci/scripts/run_sklearn_tests.sh cpu
if [ -n "${DALROOT}" ] && [ "${DALROOT}" != "${CONDA_PREFIX}" ]; then source ${DALROOT}/env/vars.sh; fi
if [ -n "${TBBROOT}" ] && [ "${TBBROOT}" != "${CONDA_PREFIX}" ]; then source ${TBBROOT}/env/vars.sh; fi
if [ -z "${NO_DPC}" ]; then export CPU="cpu"; fi
bash .ci/scripts/run_sklearn_tests.sh $CPU
env:
DALROOT: ${{ variables.DALROOT }}
TBBROOT: ${{ variables.TBBROOT }}
NO_DPC: ${{ variables.NO_DPC }}
displayName: "Sklearn testing"
condition: succeededOrFailed()
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
bash .ci/scripts/run_sklearn_tests.sh cpu
if [ -n "${DALROOT}" ] && [ "${DALROOT}" != "${CONDA_PREFIX}" ]; then source ${DALROOT}/env/vars.sh; fi
if [ -n "${TBBROOT}" ] && [ "${TBBROOT}" != "${CONDA_PREFIX}" ]; then source ${TBBROOT}/env/vars.sh; fi
if [ -z "${NO_DPC}" ]; then export CPU="cpu"; fi
bash .ci/scripts/run_sklearn_tests.sh $CPU
env:
DALROOT: ${{ variables.DALROOT }}
TBBROOT: ${{ variables.TBBROOT }}
NO_DPC: ${{ variables.NO_DPC }}
SKLEARNEX_PREVIEW: "YES"
displayName: "Sklearn testing [preview]"
condition: succeededOrFailed()
8 changes: 8 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ fi

if [ -z "${DALROOT}" ]; then
export DALROOT=${PREFIX}
elif [ "${DALROOT}" != "${CONDA_PREFIX}" ]; then
# source oneDAL if DALROOT is set outside of conda-build
source ${DALROOT}/env/vars.sh
david-cortes-intel marked this conversation as resolved.
Show resolved Hide resolved
fi

if [ -n "${TBBROOT}" ] && [ "${TBBROOT}" != "${CONDA_PREFIX}" ]; then
# source TBB if TBBROOT is set outside of conda-build
source ${TBBROOT}/env/vars.sh
fi

if [ -z "${MPIROOT}" ] && [ -z "${NO_DIST}" ]; then
Expand Down
10 changes: 10 additions & 0 deletions conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ if [ -z "${PYTHON}" ]; then
export PYTHON=python
fi

if [ -n "${DALROOT}" ] && [ "${DALROOT}" != "${CONDA_PREFIX}" ]; then
# source oneDAL if DALROOT is set outside of conda-build
source ${DALROOT}/env/vars.sh
fi

if [ -n "${TBBROOT}" ] && [ "${TBBROOT}" != "${CONDA_PREFIX}" ]; then
# source TBB if TBBROOT is set outside of conda-build
source ${TBBROOT}/env/vars.sh
fi

# Note: execute with argument --json-report in order to produce
# a JSON report under folder '.pytest_reports'. Other arguments
# will also be forwarded to pytest.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@

trues = ["true", "True", "TRUE", "1", "t", "T", "y", "Y", "Yes", "yes", "YES"]
no_dist = True if "NO_DIST" in os.environ and os.environ["NO_DIST"] in trues else False
no_dpc = True if "NO_DPC" in os.environ and os.environ["NO_DPC"] in trues else False
no_stream = "NO_STREAM" in os.environ and os.environ["NO_STREAM"] in trues
debug_build = os.getenv("DEBUG_BUILD") == "1"
mpi_root = None if no_dist else os.environ["MPIROOT"]
dpcpp = (
shutil.which("icpx") is not None
and "onedal_dpc" in get_onedal_shared_libs(dal_root)
and os.environ.get("NO_DPC", None) is None
and not no_dpc
and not (IS_WIN and debug_build)
)

Expand Down