Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Introduction

  • In this use case, we utilize the "Cell Metrics"(RRU.PrbUsedDl) dataset provided by the O-RAN SC SIM space, which includes synthetic data generated by a simulator, with all data recorded in Unix timestamp format.

  • The model training process is carried out on the O-RAN SC AI/ML Framework, including GPU support, and considers both traditional machine learning (ML) and deep learning (DL) approaches. For ML models, we use Random Forest and Support Vector Regression (SVR), while for DL models, we employ RNN, LSTM, and GRU architectures.

  • By managing the ON/OFF state of cells through traffic forecasting, we can reduce power consumption. Additionally, if the AI/ML models used for forecasting are operated in an eco-friendly manner, further power savings can be achieved. In this use case, we measure the carbon emissions and energy consumption during the cell traffic forecasting process using AI/ML to ensure that the forecasting model is not only effective but also environmentally sustainable.

...

2. Requirements

...

...

Configuring GPU Usage in a Machine Learning Pipeline

This section is based on contributions from Sungjin Lee's Github repository. For more details, visit this link

  • Step 1. Install the nvidia-container-toolkit

    Code Block
    curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
    && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
  • Step 2. Configure containerd

    Code Block
    sudo nvidia-ctk runtime configure --runtime=containerd
    Code Block
    sudo vim /etc/containerd/config.toml
    Code Block
      [plugins."io.containerd.grpc.v1.cri".containerd]
        default_runtime_name = "nvidia" # Change to "nvidia"
        # Additional configurations are omitted
    
      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
    
        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
          BinaryName = "/usr/bin/nvidia-container-runtime"
          # Additional configurations are omitted
    
    
        # Include the following content below
        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.env]
          LD_LIBRARY_PATH = "/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64"
    Code Block
    # Restart containerd service
    sudo systemctl restart containerd
  • Step 3. Install the nvidia-device-plugin

    Code Block
    kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.16.2/deployments/static/nvidia-device-plugin.yml
  • Step 4. Build the traininghost/pipelinegpuimage image

    • We built a new base image that recognizes the configured GPU to enable proper GPU usage in the ML pipeline components

    • To build the required image, you can refer to the provided Dockerfile and requirement.txt at the following link, or modify the pipeline image available in the existing aimlfw-dep

    Code Block
    sudo buildctl --addr=nerdctl-container://buildkitd build \
        --frontend dockerfile.v0 \
        --opt filename=Dockerfile.pipeline_gpu \
        --local dockerfile=pipeline_gpu \
        --local context=pipeline_gpu \
        --output type=oci,name=traininghost/pipelinegpuimage:latest | sudo nerdctl load --namespace k8s.io
  • Step 5. Verify GPU usage with nerdctl

    • If the output is similar to the one below, the GPU setup is complete.

    Code Block
    sudo nerdctl run -it --rm --gpus all --namespace k8s.io -p 8888:8888 -v $(pwd):/app_run traininghost/pipelinegpuimage:latest /bin/bash -c "nvidia-smi"

3. Getting Started

1. Viavi Dataset Insertion

  • Step 1. Download or Copy insert.py file available in the "File List" on this page

  • Step 2. Update the insert.py file with the appropriate values for your database(InfluxDB), including token, org, bucket, and the file location of the dataset(csv_file)

    • the bucket for Viavi dataset must already be created

    Code Block
    # InfluxDB connection settings
    url = "http://localhost:8086"
    token = "JEQWYIOLvB4iOwJp8BwA"
    org = "primary"
    bucket = "Viavi_Dataset"
    csv_file = "CellReports.csv"
  • Step 3. Install insert.py

    • It takes about 10 min to insert all the Viavi dataset

    Code Block
    python3 insert.py

2. Setting FeatureGroup

...

  • Refer to the image below, and make sure to set _measurement to "cell_metrics"

...

3. Upload AI/ML Pipeline Script (jupyter notebook)

...

  • Step 1. Download the pieline script provided in the “File List”

  • Step 2. Modify the pipeline script to satisfy your requirements

    • Set data features required for model training (using FeatureStoreSdk)

      • The provided pipeline script uses the RRU_PrbUsedDl column from the Viavi Dataset

      • You can modify this based on your needs

    • Write a TensorFlow-based AI/ML model script

      • The provided pipeline script uses an LSTM(Long Short-Term Memory) model

      • You can add other model prediction accuracy(ex. RMSE, MAE, MAPE)

    • Configure Energy and CO2 emission tracking for the Green Network use case using CodeCarbon

      • Train

4. TrainingJob

5. Result

4. File list

  • CellReports.csv

  • View file
    nameGPU_insert.py

    The file processes the GPU_dataset and inserts the data into InfluxDB.
    (Changed required: DATASET_PATH , INFLUX_IP , INFLUX_TOKEN)

  • View file
    namepipeline.ipynb

  • add inference files….(inference 실행되는 sh 파일, 예시 input 파일, 예시 output 파일)

5. Example

Contributors

  • Peter Moonki Hong - Samsung

  • Taewan Kim - Samsung

  • Corbin(Geon) Kim - Kyunghee Univ. MCL

  • Sungjin Lee - Kyunghee Univ. MCL

  • Hyuksun Kwon - Kyunghee Univ. MCL

  • Hoseong Choi - Kyunghee Univ. MCL

...