Ausführen eines mit „ AutoAI “ erstellten Notebooks auf IBM Z und IBM LinuxONE

Sie können ein Notizbuch verwenden, das durch die Ausführung eines Experiments unter „ AutoAI “ außerhalb von „ Cloud Pak for Data “ auf der Hardware von „ IBM Z “ und „ IBM LinuxONE “ erstellt wurde. Um das Notebook auszuführen, müssen Sie die Umgebung „ Python “ mit den Paketen einrichten, die für die Ausführung des generierten Notebooks erforderlich sind. Verwenden Sie dazu conda.

Einrichten einer „ Python “-Umgebung für das Betriebssystem „ Linux on IBM Z and LinuxONE “

Um ein Experiment unter AutoAI durchzuführen, das Pakete verwendet, die im Standard-Conda-Kanal Linux on IBM Z and LinuxONE nicht verfügbar sind, müssen Sie Ihre Python -Umgebung mit den erforderlichen Paketen einrichten, indem Sie die benötigten Pakete kompilieren und die Umgebung entsprechend konfigurieren.

Befolgen Sie diese Schritte, um Ihre Umgebung anzupassen, indem Sie die Pakete und tensorflow hinzufügen pyarrow , die im Standard-conda-Kanal Linux on IBM Z and LinuxONE nicht verfügbar sind, und installieren Sie die Pakete „ AutoAI “ (autoai-libs und autoai-ts-libs), um von AutoAI generierte Notebooks außerhalb von Cloud Pak for Data auf den Plattformen IBM Z und LinuxONE auszuführen.

Anpassen der Umgebung für die Laufzeit- 24.1

  1. Installieren Sie Conda auf dem Betriebssystem „ Linux on IBM Z and LinuxONE “.

  2. Bereiten Sie die pyarrow 11.0.0 Python Paketinstallationsabhängigkeiten mit Open-CE vor.

    1. Erstellen Sie eine conda-Umgebung. In der Standard-Conda-Umgebung,

      Hinweis:

      In diesem Beispiel wird /opt als Arbeitsverzeichnis für den lokalen conda-Kanal verwendet.

      In der Basis-Conda-Umgebung:

      conda install -y conda-build
      

      Danach:

      cd /opt
      conda create -y -n pyarrow-env python=3.10
      conda activate pyarrow-env
      conda install -y -c open-ce open-ce-builder
      
    2. Erstellen Sie einen Git-Klon des Open-CE-Projekts und checken Sie das Release in den open-ce-r1.9-Zweig aus.

      git clone -b open-ce-r1.9 https://github.com/open-ce/open-ce.git
      
    3. Installieren Sie ein Patch-Paket mit dem folgenden Befehl:

      yum install patch gcc gcc-c++
      
    4. Navigieren Sie zum Open-CE-Projekt und erstellen Sie die pyarrow-Abhängigkeiten.

      cd open-ce
      open-ce build env --python_versions 3.10 --build_types cpu envs/arrow-env.yaml
      
    5. Überprüfen Sie den Condabuild-Ordner, um die pyarrow-Abhängigkeiten zu finden

      ls -1 condabuild/
      channeldata.json
      index.html
      linux-s390x
      noarch
      opence-conda-env-py3.10-cpu-openmpi.yaml
      ******************************************************
      ls -1 condabuild/linux-s390x/
      arrow-cpp-11.0.0-py310hb252c34_2_cpu.conda
      arrow-cpp-proc-11.0.0-cpu.conda
      boost-cpp-1.65.1-hebff1d6_4.conda
      cryptography-41.0.4-opence_py310_he9533b4_0.conda
      cryptography-vectors-41.0.4-py310h77c88a5_0.conda
      current_repodata.json
      current_repodata.json.bz2
      ffmpeg-4.2.2-opence_0.conda
      gflags-2.2.2-heb72281_0.conda
      glog-0.5.0-he499f12_0.conda
      grpc-cpp-1.41.0-hf453556_pb4.21.12_6.conda
      index.html
      libabseil-20230125.0-cxx17_he499f12_1.conda
      libboost-1.65.1-h896dd0f_4.conda
      libevent-2.1.10-h8df5d65_2.conda
      libprotobuf-3.21.12-h6cabbc9_0.conda
      libprotobuf-static-3.21.12-he0b681d_0.conda
      libthrift-0.13.0-h333d347_6.conda
      libvpx-1.11.0-h3de3984_0.conda
      orc-1.8.2-h9978810_3.conda
      protobuf-4.21.12-py310h3de3984_1.conda
      pyarrow-11.0.0-py310h7cdfc66_2_cpu.conda
      rapidjson-1.1.0-h4cc523a_0.conda
      repodata_from_packages.json
      repodata_from_packages.json.bz2
      repodata.json
      repodata.json.bz2
      rust-1.71.1-ha869a9c_0.conda
      rust_linux-s390x-1.71.1-hf505785_1.conda
      thrift-compiler-0.13.0-h333d347_6.conda
      thrift-cpp-0.13.0-6.conda
      tokenizers-0.13.3-opence_py310_heabbc7f_0.conda
      xsimd-9.0.1-h4cc523a_0.conda
      yasm-1.3.0-h532a228_2.conda
      
    6. Deaktivieren Sie die virtuelle Umgebung pyarrow-env conda und wechseln Sie zurück in das Verzeichnis /opt.

  3. Bereiten Sie die Tensorflow Python Paket Installationsabhängigkeiten mit Open-CE vor.

    Hinweis:

    Dieses Paket ist im Conda-Kanal unter IBM Z und IBM LinuxONE nicht verfügbar.

    1. Erstellen Sie eine conda-Umgebung.
      cd /opt
      conda create -y -n tensorflow-env python=3.10
      conda activate tensorflow-env
      conda install -y -c open-ce open-ce-builder
      
    2. Navigieren Sie zu dem Open-CE Projekt und bauen Sie die Tensorflow Abhängigkeiten.
      cd /opt/open-ce
      open-ce build env --python_versions 3.10 --build_types cpu envs/tensorflow-env.yaml
      
    3. Überprüfen Sie den condabuild-Ordner, um die tensorflow-cpu-Abhängigkeiten zu finden.
      ls -1 condabuild/
      channeldata.json
      index.html
      linux-s390x
      noarch
      opence-conda-env-py3.10-cpu-openmpi.yaml
      ******************************************************
      ls -1 condabuild/linux-s390x/
      absl-py-1.0.0-py310h77c88a5_0.conda
      array-record-0.2.0-py310he127c3e_1.conda
      bazel-5.3.0-h447df78_1.conda
      bazel-toolchain-0.1.5-h1589012_0.conda
      black-22.12.0-py310h6d39d64_0.conda
      clang-14.0.6-0.conda
      clang-14-14.0.6-default_hc034eec_0.conda
      clangdev-14.0.6-default_hc034eec_0.conda
      clang-format-14.0.6-default_hc034eec_0.conda
      clang-format-14-14.0.6-default_hc034eec_0.conda
      clang-tools-14.0.6-default_hc034eec_0.conda
      clangxx-14.0.6-default_h050e89a_0.conda
      cryptography-41.0.4-opence_py310_he9533b4_0.conda
      cryptography-vectors-41.0.4-py310h77c88a5_0.conda
      current_repodata.json
      current_repodata.json.bz2
      dm-tree-0.1.7-py310h93d806b_1.conda
      ffmpeg-4.2.2-opence_0.conda
      flatbuffers-2.0.0-he499f12_0.conda
      grpc-cpp-1.41.0-hf453556_pb4.21.12_6.conda
      grpcio-1.53.0-py310h40f4e1e_0.conda
      index.html
      jax-0.4.7-cpu_py310_2.conda
      jaxlib-0.4.7-cpu_py310_pb4.21.12_4.conda
      keras-2.12.0-py310hc450ce1_3.conda
      libabseil-20230125.0-cxx17_he499f12_1.conda
      libclang13-14.0.6-default_h99f1993_0.conda
      libclang-14.0.6-default_hc034eec_0.conda
      libclang-cpp-14.0.6-default_hc034eec_0.conda
      libclang-cpp14-14.0.6-default_hc034eec_0.conda
      libprotobuf-3.21.12-h6cabbc9_0.conda
      libprotobuf-static-3.21.12-he0b681d_0.conda
      libtensorflow-2.12.0-he2d1015_cpu_pb4.21.12_4.conda
      libvpx-1.11.0-h3de3984_0.conda
      ml_dtypes-0.1.0-py310h9bf4de2_0.conda
      promise-2.3-py310h6d39d64_0.conda
      protobuf-4.21.12-py310h3de3984_1.conda
      repodata_from_packages.json
      repodata_from_packages.json.bz2
      repodata.json
      repodata.json.bz2
      rust-1.71.1-ha869a9c_0.conda
      rust_linux-s390x-1.71.1-hf505785_1.conda
      tensorflow-addons-0.19.0-py310h7f2d79a_1_cpu.conda
      tensorflow-addons-proc-0.19.0-cpu.conda
      tensorflow-base-2.12.0-cpu_py310_pb4.21.12_4.conda
      tensorflow-cpu-2.12.0-py310_1.conda
      tensorflow-model-optimization-0.7.4-py310_2.conda
      tensorflow-probability-0.19.0-py310_1.conda
      _tensorflow_select-1.0-cpu_2.conda
      tensorflow-text-2.12.0-h14c02a0_py310_pb4.21.12_2.conda
      tokenizers-0.13.3-opence_py310_heabbc7f_0.conda
      yasm-1.3.0-h532a228_2.conda
      
  4. Führen Sie den Befehl conda index für den Ordner condabuild aus.

    conda index condabuild
    
  5. Fügen Sie die folgenden Zeilen in die Datei ~/.condarc ein, um den Ordner condabuild als lokalen conda-Kanal zu verwenden.

    channels:
    - /opt/open-ce/condabuild
    - defaults
    
  6. Überprüfen Sie den Conda-Kanal, um das pyarrow und tensorflow-cpu Installationspaket zu finden.

    conda search pyarrow
    conda search tensorflow-cpu
    
    Loading channels: done
    # Name             Version       Build                 Channel
    pyarrow            11.0.0   py310h7cdfc66_2_cpu   condabuild
    (tensorflow) [root@recorder1 open-ce]# conda search tensorflow-cpu
    Loading channels: done
    # Name              Version           Build           Channel
    tensorflow-cpu       2.12.0         py310_1         condabuild
    (tensorflow) [root@recorder1 open-ce]#
    
  7. Deaktivieren Sie die virtuelle Umgebung tensorflow-env conda und navigieren Sie zurück zum Verzeichnis /opt.

    conda deactivate
    cd /opt
    
  8. Erstellen Sie eine virtuelle Conda-Umgebung für die autoai-Installation und aktivieren Sie diese.

    conda create -y -n autoai python=3.10
    conda activate autoai
    
  9. Erstellen Sie die Datei requirements.linux-s390x.txt und fügen Sie ihr diese Pakete hinzu:

    cython<3
    matplotlib
    pandas>=0.24.2,<1.6
    numpy>=1.20.3,<1.24
    packaging
    psutil
    importlib-metadata
    coverage
    urllib3<2
    xgboost>=1.6.1
    typing_extensions
    pyarrow
    scikit-learn>=1.0.2,<1.2
    tensorflow-cpu>=2.7.0,<2.13
    joblib>=0.11
    statsmodels<0.14
    dill>=0.3.1.1
    networkx>=2.5.1
    py4j>=0.10.9,<0.10.10
    jpype1>=1.3.0
    simplejson==3.17.6
    PyWavelets
    pytz
    traitlets<6
    boto3==1.24.28
    deprecated==1.2.13
    pyyaml==6.0
    semver==2.13.0
    ijson==3.1.4
    munch==2.5.0
    
  10. Installieren Sie die conda-Pakete aus der Datei requirements.linux-s390x.txt.

    conda install -y --file requirements.linux-s390x.txt
    
  11. Erstellen Sie die Datei requirements.linux-s390x.pypi.txt und fügen Sie ihr diese Pakete hinzu:

    gensim==4.1.2
    pytest
    pytest-cov
    pep8
    pytest-pep8
    ibm-watson-machine-learning
    mlxtend>=0.17.0
    lale>=0.6.8,<0.8
    alchemy-config==1.1.2
    alchemy-logging==1.2.1
    anytree==2.9.0
    jsons==1.3.1
    import-tracker==3.1.5
    
  12. Installieren Sie die Datei requirements.linux-s390x.pypi.txt.

    pip install -r requirements.linux-s390x.pypi.txt
    
  13. Installieren Sie autoai-libs und autoai-ts-libs:

    pip install autoai-libs==1.16.2 --no-deps
    pip install autoai-ts-libs==3.0.23 --no-deps
    

Anpassen der Umgebung für die Laufzeit- 25.1

  1. Installieren Sie Conda auf dem Betriebssystem „ Linux on IBM Z and LinuxONE “.

  2. Bereiten Sie die pyarrow 19.0.0 Python Paketinstallationsabhängigkeiten mit Open-CE vor.

    Hinweis:

    Dieses Paket ist im Conda-Kanal unter IBM Z und IBM LinuxONE nicht verfügbar.

    1. Erstellen Sie eine conda-Umgebung. In der Standard-Conda-Umgebung,

      Hinweis:

      In diesem Beispiel wird /opt als Arbeitsverzeichnis für den lokalen conda-Kanal verwendet.

      In der Basis-Conda-Umgebung:

      conda install -y conda-build
      

      Danach:

      cd /opt
      conda create -y -n pyarrow-env python=3.10
      conda activate pyarrow-env
      conda install -y -c open-ce open-ce-builder==13.0.*
      
    2. Erstellen Sie einen Git-Klon des Open-CE-Projekts und checken Sie das Release in den open-ce-v1.11.7-Zweig aus.

      git clone -b open-ce-v1.11.7 https://github.com/open-ce/open-ce.git
      
    3. Installieren Sie ein Patch-Paket mit dem folgenden Befehl:

      yum install patch gcc gcc-c++
      
    4. Navigieren Sie zum Open-CE-Projekt und erstellen Sie die pyarrow-Abhängigkeiten.

      Hinweis: Bearbeite die Datei „ envs/conda_build_config.yaml “, um die Datei „ arrow==19.0.0 “ zu aktualisieren
      cd open-ce
      open-ce build env --python_versions 3.12 --build_types cpu envs/arrow-env.yaml
      
    5. Überprüfen Sie den Condabuild-Ordner, um die pyarrow-Abhängigkeiten zu finden

      ls -1 condabuild/
      channeldata.json
      index.html
      linux-s390x
      noarch
      opence-conda-env-py3.12-cpu-openmpi.yaml
      ******************************************************
      ls -1 condabuild/linux-s390x/
      arrow-cpp-19.0.0-py312h7d206ee_3_cpu.tar.bz2
      arrow-cpp-proc-19.0.0-cpu.tar.bz2
      brotli-1.2.0-h4ad59ea_1.tar.bz2
      brotli-bin-1.2.0-h68c1173_1.tar.bz2
      brotli-python-1.2.0-py312h803a580_1.tar.bz2
      current_repodata.json
      grpc-cpp-1.54.3-hf453556_pb3.21.12_2.tar.bz2
      index.html
      libabseil-20230125.0-cxx17_he499f12_1.tar.bz2
      libbrotlicommon-1.2.0-h68c1173_1.tar.bz2
      libbrotlidec-1.2.0-h68c1173_1.tar.bz2
      libbrotlienc-1.2.0-h68c1173_1.tar.bz2
      libprotobuf-3.21.12-hba2ed08_0.tar.bz2
      libprotobuf-static-3.21.12-h21fe93e_0.tar.bz2
      libzlib-1.2.13-hebff1d6_4.tar.bz2
      orc-1.9.0-h9978810_2.tar.bz2
      protobuf-4.21.12-py312h3de3984_1.tar.bz2
      pyarrow-19.0.0-py312h7876fa0_3_cpu.tar.bz2
      repodata_from_packages.json
      repodata.json
      rust-1.81.0-h5760ecf_0.tar.bz2
      rust_linux-s390x-1.81.0-h02bb431_2.tar.bz2
      zlib-1.2.13-hebff1d6_4.tar.bz2
      
    6. Deaktivieren Sie die virtuelle Umgebung pyarrow-env conda und wechseln Sie zurück in das Verzeichnis /opt.

  3. Bereiten Sie die Tensorflow Python Paket Installationsabhängigkeiten mit Open-CE vor.

    Hinweis: Dieses Paket ist nicht im Conda-Kanal unter IBM Z und IBM LinuxONE verfügbar.
    1. Erstellen Sie eine conda-Umgebung.
      cd /opt
      conda create -y -n tensorflow-env python=3.10
      conda activate tensorflow-env
      conda install -y -c open-ce open-ce-builder==13.0.*
      
    2. Navigieren Sie zu dem Open-CE Projekt und bauen Sie die Tensorflow Abhängigkeiten.
      cd /opt/open-ce
      open-ce build env --python_versions 3.12 --build_types cpu envs/tensorflow-env.yaml
      
    3. Überprüfen Sie den condabuild-Ordner, um die tensorflow-cpu-Abhängigkeiten zu finden.
      ls -1 condabuild/
      channeldata.json
      index.html
      linux-s390x
      noarch
      opence-conda-env-py3.10-cpu-openmpi.yaml
      ******************************************************
      ls -1 condabuild/linux-s390x/
      absl-py-1.0.0-py310h77c88a5_0.conda
      array-record-0.2.0-py310he127c3e_1.conda
      bazel-5.3.0-h447df78_1.conda
      bazel-toolchain-0.1.5-h1589012_0.conda
      black-22.12.0-py310h6d39d64_0.conda
      clang-14.0.6-0.conda
      clang-14-14.0.6-default_hc034eec_0.conda
      clangdev-14.0.6-default_hc034eec_0.conda
      clang-format-14.0.6-default_hc034eec_0.conda
      clang-format-14-14.0.6-default_hc034eec_0.conda
      clang-tools-14.0.6-default_hc034eec_0.conda
      clangxx-14.0.6-default_h050e89a_0.conda
      cryptography-41.0.4-opence_py310_he9533b4_0.conda
      cryptography-vectors-41.0.4-py310h77c88a5_0.conda
      current_repodata.json
      current_repodata.json.bz2
      dm-tree-0.1.7-py310h93d806b_1.conda
      ffmpeg-4.2.2-opence_0.conda
      flatbuffers-2.0.0-he499f12_0.conda
      grpc-cpp-1.41.0-hf453556_pb4.21.12_6.conda
      grpcio-1.53.0-py310h40f4e1e_0.conda
      index.html
      jax-0.4.7-cpu_py310_2.conda
      jaxlib-0.4.7-cpu_py310_pb4.21.12_4.conda
      keras-2.12.0-py310hc450ce1_3.conda
      libabseil-20230125.0-cxx17_he499f12_1.conda
      libclang13-14.0.6-default_h99f1993_0.conda
      libclang-14.0.6-default_hc034eec_0.conda
      libclang-cpp-14.0.6-default_hc034eec_0.conda
      libclang-cpp14-14.0.6-default_hc034eec_0.conda
      libprotobuf-3.21.12-h6cabbc9_0.conda
      libprotobuf-static-3.21.12-he0b681d_0.conda
      libtensorflow-2.12.0-he2d1015_cpu_pb4.21.12_4.conda
      libvpx-1.11.0-h3de3984_0.conda
      ml_dtypes-0.1.0-py310h9bf4de2_0.conda
      promise-2.3-py310h6d39d64_0.conda
      protobuf-4.21.12-py310h3de3984_1.conda
      repodata_from_packages.json
      repodata_from_packages.json.bz2
      repodata.json
      repodata.json.bz2
      rust-1.71.1-ha869a9c_0.conda
      rust_linux-s390x-1.71.1-hf505785_1.conda
      tensorflow-addons-0.19.0-py310h7f2d79a_1_cpu.conda
      tensorflow-addons-proc-0.19.0-cpu.conda
      tensorflow-base-2.12.0-cpu_py310_pb4.21.12_4.conda
      tensorflow-cpu-2.12.0-py310_1.conda
      tensorflow-model-optimization-0.7.4-py310_2.conda
      tensorflow-probability-0.19.0-py310_1.conda
      _tensorflow_select-1.0-cpu_2.conda
      tensorflow-text-2.12.0-h14c02a0_py310_pb4.21.12_2.conda
      tokenizers-0.13.3-opence_py310_heabbc7f_0.conda
      yasm-1.3.0-h532a228_2.conda
      
  4. Führen Sie den Befehl conda index für den Ordner condabuild aus.

    conda index condabuild
    
  5. Fügen Sie die folgenden Zeilen in die Datei ~/.condarc ein, um den Ordner condabuild als lokalen conda-Kanal zu verwenden.

    channels:
    - /opt/open-ce/condabuild
    - defaults
    
  6. Überprüfen Sie den Conda-Kanal, um das pyarrow und tensorflow-cpu Installationspaket zu finden.

    conda search pyarrow
    conda search tensorflow-cpu
    
    Loading channels: done
    # Name             Version       Build                 Channel
    pyarrow            19.0.0   py312h7cdfc66_2_cpu   condabuild
    (tensorflow) [root@recorder1 open-ce]# conda search tensorflow-cpu
    Loading channels: done
    # Name              Version           Build           Channel
    tensorflow-cpu       2.18.0         py312_1         condabuild
    (tensorflow) [root@recorder1 open-ce]#
    
  7. Deaktivieren Sie die virtuelle Umgebung tensorflow-env conda und navigieren Sie zurück zum Verzeichnis /opt.

    conda deactivate
    cd /opt
    
  8. Erstellen Sie eine virtuelle Conda-Umgebung für die autoai-Installation und aktivieren Sie diese.

    conda create -y -n autoai python=3.12
    conda activate autoai
    
  9. Erstellen Sie die Datei requirements.linux-s390x.txt und fügen Sie ihr diese Pakete hinzu:

    cython<3
    matplotlib
    pandas>=0.24.2,<2.3
    numpy>=1.20.3,<2.1
    packaging
    psutil
    importlib-metadata
    coverage
    urllib3<3
    xgboost>=2.1.4
    typing_extensions
    pyarrow==19.0.0
    scipy
    scikit-learn>=1.0.2,<1.7
    tensorflow==2.18.1
    joblib>=0.11
    statsmodels==0.14.4
    dill>=0.3.1.1
    networkx>=2.5.1
    py4j>=0.10.9,<0.10.10
    jpype1>=1.3.0
    simplejson==3.20.2
    PyWavelets
    pytz
    traitlets<6
    boto3==1.37.27
    deprecated==1.2.18
    pyyaml==6.0.3
    semver==2.13.0
    ijson==3.3.0
    munch==2.5.0
    
  10. Installieren Sie die conda-Pakete aus der Datei requirements.linux-s390x.txt.

    conda install -y --file requirements.linux-s390x.txt
    
  11. Erstellen Sie die Datei requirements.linux-s390x.pypi.txt und fügen Sie ihr diese Pakete hinzu:

    gensim==4.3.3
    pytest
    pytest-cov
    pep8
    pytest-pep8
    ibm_watsonx_ai
    mlxtend>=0.17.0
    lale>=0.6.8,<0.10
    alchemy-config==1.1.3
    alchemy-logging==1.5.0
    anytree==2.12.1
    jsons==1.3.1
    import-tracker==3.2.1
    
  12. Installieren Sie die Datei requirements.linux-s390x.pypi.txt.

    pip install -r requirements.linux-s390x.pypi.txt
    
  13. Installieren Sie autoai-libs und autoai-ts-libs:

    pip install autoai-libs==3.0.10 --no-deps
    pip install autoai-ts-libs==5.0.5 --no-deps
    

Weitere Informationen

Planung für Cloud Pak for Data auf IBM Z und LinuxONE