IBM / transition-amr-parser

SoTA Abstract Meaning Representation (AMR) parsing with word-node alignments in Pytorch. Includes checkpoints and other tools such as statistical significance Smatch.
Apache License 2.0
245 stars 48 forks source link

Bus Error when checking installation #37

Closed Vladislavlhp7 closed 2 years ago

Vladislavlhp7 commented 2 years ago

Hello,

After installing the necessary packages with:

source set_environment.sh
pip install --editable .

When I run the bash tests/correctly_installed.sh, I get:

pytorch 1.10.1
No CUDA available
smatch installed
tests/correctly_installed.sh: line 10:  2319 Bus error: 10           python tests/correctly_installed.py

Would you happen to know what causes this?

Worth keeping in mind is that:

Thanks in advance!

ramon-astudillo commented 2 years ago

Given that the error happens just after checking Smatch, the culprit seems to be torch-scatter

https://github.com/IBM/transition-amr-parser/blob/master/tests/correctly_installed.py#L40

Note that it does install in OSX Monterrey and a couple of versions back and that Python. By experience torch-scatter gives the most install problems. I would try to redo the install from scratch trying some variations.

a) Install it by separate with pip. Comment it in

https://github.com/IBM/transition-amr-parser/blob/master/setup.py#L8

and do a pip install manually after all the rest installs

b) same but try installing with conda

c) try the conda pre-install of other modules explained in the README install instructions and install torch-scatter inside of the setup or as a) b).

Vladislavlhp7 commented 2 years ago

Hello,

Thanks for your swift comment. What I am doing below does not seem to work:

  1. Comment # 'torch-scatter==2.0.9' in the setup.py file
  2. Execute:
    source set_environment.sh
    pip install --editable .
    pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.1+$cpu.html

Error is still the same:

pytorch 1.10.1
No CUDA available
smatch installed
tests/correctly_installed.sh: line 10: 12174 Bus error: 10           python tests/correctly_installed.py

Also, when I am trying to install the torch-scatter with conda, it does not work either:

conda install pytorch-scatter=2.0.9 -c pyg

Are these two following commands correct at all? pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.1+$cpu.html conda install pytorch-scatter=2.0.9 -c pyg

Appreciate the help!

Regards Vlad

ramon-astudillo commented 2 years ago

Are these two following commands correct at all?

just

pip install torch-scatter==2.0.9

after installing the rest worked for me in the past.

If you install and try

import torch_scatter

do you get some more verbose error message than just BUS error?

torch-scatter problems are normally linking libraries. maybe we are working on the wrong hypothesis.

Vladislavlhp7 commented 2 years ago

Hello,

This again results in bus error for some reason ...

(venv) (base) vladislav@Vladislavs-MacBook-Pro transition-amr-parser % pip install torch-scatter==2.0.9
Collecting torch-scatter==2.0.9
  Using cached torch_scatter-2.0.9-cp38-cp38-macosx_10_9_x86_64.whl
Installing collected packages: torch-scatter
Successfully installed torch-scatter-2.0.9
(venv) (base) vladislav@Vladislavs-MacBook-Pro transition-amr-parser % python3 
Python 3.8.5 (default, Sep  4 2020, 02:22:02) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch_scatter
zsh: bus error  python3

Would you have any other suggestions?

Much appreciated!

ramon-astudillo commented 2 years ago

The error is weirdly short and it seems to indicate that python3 does something bad (request too much memory?) and then is killed. It also indicates that you are using zsh and not bash. Maybe a zsh problem? Never had this type of behavior (but as said torch-scatter is problematic).

I would try to do installs of torch and torch-scatter in isolation, see if you can reproduce the behavior.

Also, in the past we used torch-scatter==1.3.2 may not work with current versions of other modules but you could try.

Vladislavlhp7 commented 2 years ago

Hello,

Big thank you for the suggestion to use version 1.3.2!

After:

(venv) (base) vladislav@Vladislavs-MacBook-Pro transition-amr-parser % pip install torch-scatter==1.3.2
Collecting torch-scatter==1.3.2
  Downloading torch_scatter-1.3.2.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: torch-scatter
  Building wheel for torch-scatter (setup.py) ... done
  Created wheel for torch-scatter: filename=torch_scatter-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl size=80682 sha256=680c56eb88c7255b92f48309c27cd56322c3eba0af4a6c9c5323f4d2b6829157
  Stored in directory: /Users/vladislav/Library/Caches/pip/wheels/26/39/34/e8b79b0c890cefdb07ff5d2c3da35d01cc8016f85d67a3a7b4
Successfully built torch-scatter
Installing collected packages: torch-scatter
  Attempting uninstall: torch-scatter
    Found existing installation: torch-scatter 2.0.9
    Uninstalling torch-scatter-2.0.9:
      Successfully uninstalled torch-scatter-2.0.9
Successfully installed torch-scatter-1.3.2

The installation of the project looks successful:

(venv) (base) vladislav@Vladislavs-MacBook-Pro transition-amr-parser % bash tests/correctly_installed.sh

pytorch 1.10.1
No CUDA available
smatch installed
pytorch-scatter installed
fairseq works
[OK] correctly installed

Should I expect any issues by using torch-scatter==1.3.2 in the parser?

Thanks again!

ramon-astudillo commented 2 years ago

AFAIK, functionally they should be equivalent. You ca run

bash tests/minimal_test.sh

to see if it breaks anywhere

Vladislavlhp7 commented 2 years ago

Supposedly, at the end of the minimal tests run, after passing through the stages of the test pipeline [1], a warning occurs [2]. Is that an expected behaviour?

[1]:

F-score: 0.0061
[ done  ] DATA/wiki25/aligned/ibm_neural_aligner/
[ done  ] DATA/wiki25/oracles/ibm_neural_aligner_o10_act-states-5sample_a/
[ done  ] DATA/wiki25/embeddings/ibm_neural_aligner_bart.large
[ done  ] DATA/wiki25/features/ibm_neural_aligner_o10_act-states-5sample_a_ibm_neural_aligner_bart.large//
[  6/6  ] DATA/wiki25/models/wiki25-structured-bart-base-neur-al-sampling5/seed42/epoch_tests
[ 10/10 ] DATA/wiki25/models/wiki25-structured-bart-base-neur-al-sampling5/seed42
[ pend  ] DATA/wiki25/models/wiki25-structured-bart-ba ... heckpoint_wiki.smatch_top5-avg.pt.wiki.smatch

[2]:

F-score: 0.0061

[OK] tests/minimal_test.sh
(venv) (base) vladislav@Vladislavs-MacBook-Pro transition-amr-parser % /Users/vladislav/anaconda3/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Thanks for the swift responses!

ramon-astudillo commented 2 years ago

that seems to be fairseqs multithread. I would file it under all ok :). Closing this.