llvm / llvm/torch-mlir

Problem setting up to run the demo listed in README.txt

Open
#3,590 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.9k
Forks
736
Avg merge
5d 22h
Merged PRs (30d)
15

Description

I am trying to set up a Docker container to run the demo as described prior to TorchScript ResNet18.

Actions attempting to follow the README instructions:

  1. Set up a Dockerfile (this was not in the instructions, but is required for reproducibility):
FROM nvidia/cuda:11.8.0-base-ubuntu22.04

ENV PYTHON_VERSION=3.11

ENV PATH=/opt/conda/bin:$PATH
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/conda/lib"

ENV PYTHONIOENCODING=UTF-8
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV CONDA_AUTO_UPDATE_CONDA=false

RUN apt update
RUN apt install -y bash \
    build-essential \
    git \
    curl \
    ca-certificates \
    wget \
    && rm -rf /var/lib/apt/lists

# Install Miniconda and create main env
ADD https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh miniconda3.sh
RUN /bin/bash miniconda3.sh -b -p /opt/conda \
    && rm miniconda3.sh \
    && /opt/conda/bin/conda install -y -c anaconda \
    python=$PYTHON_VERSION \
    && /opt/conda/bin/conda clean -ya

RUN /opt/conda/bin/conda config --set ssl_verify False \
    && pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org \
    && ln -s /opt/conda/bin/pip /usr/local/bin/pip3

# Install requirements
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt \
    && rm requirements.txt

CMD ["/bin/bash"]
  1. Build the image, then execute the following inside a running container -
root@4415caed30f5:/# python3.11 -m venv mlir_venv
root@4415caed30f5:/# source mlir_venv/bin/activate
(mlir_venv) root@4415caed30f5:/# pip install --pre torch-mlir torchvision \
  --extra-index-url https://download.pytorch.org/whl/nightly/cpu
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/nightly/cpu
ERROR: Could not find a version that satisfies the requirement torch-mlir (from versions: none)
ERROR: No matching distribution found for torch-mlir
  1. Also tried the suggested "alternate" method
conda create -n torch-mlir python=3.11
conda activate torch-mlir
...

but ran into errors there also.

Discussion

Seems like some version matching problem.

With a working Dockerfile and tested setup using a specific version (rather than a latest version) the demo setup and execution should be always reproducible.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TorchScript ResNet18 setup section in README.txt and reproduce the documented pip and conda commands in the reported Docker environment. Compare the available package versions and the supplied Dockerfile and requirements.txt; done means a tested, version-specific setup path that reliably runs the demo.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops, documentation, machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.