UCLA-VAST / HARP

ICCAD'23 Best Paper Award candidate: Robust GNN-based Representation Learning for HLS
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

[BUG] Trouble installing required packages #1

Open tvottra opened 8 months ago

tvottra commented 8 months ago

I tried following the dependency setup instructions with various Python versions and tried debugging them / altering steps to no success. System: Ubuntu 22.04

Python=3.6:

Collecting requests==2.26.0
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
ERROR: Could not find a version that satisfies the requirement scikit_learn==1.0.2 (from versions: 0.9, 0.10, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.14, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.17, 0.17.1, 0.18, 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.20.4, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.22, 0.22.1, 0.22.2, 0.22.2.post1, 0.23.0, 0.23.1, 0.23.2, 0.24.0, 0.24.1, 0.24.2)

Python=3.7: Can grab dependencies. Runs with exception

Logging to /home/tvt/Software/HARP/src/logs/dse_results_v21_2024-03-06T20-49-09.815792
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    from train import train_main, inference
  File "/home/tvt/Software/HARP/src/train.py", line 4, in <module>
    from data import get_kernel_samples, split_dataset, split_dataset_resample, split_train_test_kernel
  File "/home/tvt/Software/HARP/src/data.py", line 13, in <module>
    from torch_geometric.data import Data, Batch
  File "/home/tvt/Software/HARP/venv/lib/python3.7/site-packages/torch_geometric/__init__.py", line 4, in <module>
    import torch_geometric.data
  File "/home/tvt/Software/HARP/venv/lib/python3.7/site-packages/torch_geometric/data/__init__.py", line 1, in <module>
    from .data import Data
  File "/home/tvt/Software/HARP/venv/lib/python3.7/site-packages/torch_geometric/data/data.py", line 3, in <module>
    from torch_geometric.typing import OptTensor, NodeType, EdgeType
  File "/home/tvt/Software/HARP/venv/lib/python3.7/site-packages/torch_geometric/typing.py", line 4, in <module>
    from torch_sparse import SparseTensor
ModuleNotFoundError: No module named 'torch_sparse'

Python3.10:

Collecting scipy==1.3.0 (from -r requirements.txt (line 13))
  Using cached scipy-1.3.0.tar.gz (23.6 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [1807 lines of output]
      Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.6"' don't match your environment
      Collecting wheel
        Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting setuptools
        Using cached setuptools-69.1.1-py3-none-any.whl.metadata (6.2 kB)
      Collecting Cython>=0.29.2
        Downloading Cython-3.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
      Collecting numpy==1.14.5
        Using cached numpy-1.14.5.zip (4.9 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
      Using cached setuptools-69.1.1-py3-none-any.whl (819 kB)
      Downloading Cython-3.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 87.7 MB/s eta 0:00:00
      Building wheels for collected packages: numpy
        Building wheel for numpy (pyproject.toml): started
        Building wheel for numpy (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for numpy (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [1771 lines of output]
            Running from numpy source directory.
            blas_opt_info:
            blas_mkl_info:
            customize UnixCCompiler
              libraries mkl_rt not found in ['/home/tvt/Software/HARP/venv/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
              NOT AVAILABLE

            blis_info:
            customize UnixCCompiler
              libraries blis not found in ['/home/tvt/Software/HARP/venv/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
              NOT AVAILABLE

            openblas_info:
            customize UnixCCompiler
            customize UnixCCompiler
              libraries openblas not found in ['/home/tvt/Software/HARP/venv/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
              NOT AVAILABLE

...

I'm guessing Python3.7 is the way to move forward. However, I've tried various things like upgrading the torch-* dependencies, manually pip installing torch_sparse, and etc. I always encounter some error: torch_geometric encountering a segmentation fault, numpy problems, etc. Could I please get guidance on this?

tvottra commented 8 months ago

The results of manually pip installing torch_sparse are

pragma_scope               : block
keep_pragma_attribute      : False
pragma_order               : parallel_and_merge
pragma_MLP_hidden_channels : [in_D // 2]
merge_MLP_hidden_channels  : [in_D // 2]
model_path                 : ['/home/tvt/Software/HARP/models/v21/regression_pragma_as_MLP_2l-m-2l-p_model_state_dict.pth']
ensemble                   : 0
ensemble_weights           : None
class_model_path           : /home/tvt/Software/HARP/models/v21/class_pragma_as_MLP_2l-m-2l-p_model_state_dict.pth
feature_extract            : False
fix_gnn_layer              : 1
FT_extra                   : False
save_model                 : True
resample                   : False
val_ratio                  : 0.15
activation                 : elu
D                          : 64
lr                         : 0.001
weight_decay               : 0
scheduler                  : cosine
warmup                     : linear
random_seed                : 123
batch_size                 : 64
loss                       : MSE
epoch_num                  : 200
device                     : cuda:0
explorer                   : exhaustive
model_tag                  : test
prune_util                 : True
prune_class                : True
print_every_iter           : 100
plot_pred_points           : True
user                       : tvt
hostname                   : Tommy-Linux
ts                         : 2024-03-06T21-02-42.573082
Logging to /home/tvt/Software/HARP/src/logs/dse_results_v21_2024-03-06T21-02-42.573082
Segmentation fault (core dumped)
whzzt commented 8 months ago

I have successfully installed the required packages under a Ubuntu 22.04.4 system with Python 3.8 environment. Here are the efforts I made and not mentioned in the repository, please check whether it is helpful.

Run the following bash command before installation:

sudo apt-get install libopenblas-dev liblapack-dev gfortran
export fallow_argument=-fallow-argument-mismatch
export boz_argument=-fallow-invalid-boz
export FFLAGS="$fallow_argument $boz_argument -m64"
export FCFLAGS="$fallow_argument $boz_argument -m64"

Here the last four lines are dealing with a issue regarding the compatibility of Ubuntu 22 and Ubuntu 23. I found this forum and luckily it resolved the installation problem on my machine.