Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert runtime is not None in example.py #1

Open
LonglongaaaGo opened this issue Nov 17, 2022 · 5 comments
Open

assert runtime is not None in example.py #1

LonglongaaaGo opened this issue Nov 17, 2022 · 5 comments

Comments

@LonglongaaaGo
Copy link

LonglongaaaGo commented Nov 17, 2022

Hi @lmxyy ,
Thank you so much for your awesome work!
It is a very interesting topic, and I tried to run the example.py.
However, It was not successful. Could you help give me some advice?

Traceback (most recent call last):
File "/xx/sige-main/example.py", line 98, in
main()
File "/xx/sige-main/example.py", line 87, in main
sige_output = model(edited_input)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/example.py", line 47, in forward
return self.example_module(x)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/example.py", line 33, in forward
x = self.gather(x)
File "/xx/anaconda2/envs/pt1.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/xx/sige-main/sige/nn/gather.py", line 79, in forward
assert runtime is not None
AssertionError

Thanks!

@lmxyy
Copy link
Owner

lmxyy commented Nov 17, 2022

Hi, could you provide which system and device you are using so that I can figure out what is happening? Also, you could try the example in Colab first. This should work.

@LonglongaaaGo
Copy link
Author

Hi @lmxyy ,
Thanks!
Yes, the Colab runs well.
I run on a PC with 2.90 GHz Intel R CoreTM i7-10700F CPU, 16 GB memory, NVIDIA GeForce RTX 2080 GPU.
The Pytorch version is 1.8

Thank you!

@lmxyy
Copy link
Owner

lmxyy commented Nov 18, 2022

Your environment looks good. Could you try this in your python interactive session?
image

@LonglongaaaGo
Copy link
Author

Hi @lmxyy ,
Thank you so much!
I tried and install the siga pip package.

The interactive session results are shown below:
Python 3.7.10 (default, Feb 26 2021, 18:47:35)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

import sige.cpu
sige.cpu.gather
<built-in method gather of PyCapsule object at 0x7fbd56352b10>
import sige.cuda
sige.cuda.gather
<built-in method gather of PyCapsule object at 0x7fbd54eda3f0>

However, I tried to run the example.py again and encountered the same error.

Thank you!

@lmxyy
Copy link
Owner

lmxyy commented Nov 18, 2022

This looks weird as you could import the package. Could you hack the package source code in sige/nn/base.py like this:

for device in self.devices:
    name = "sige.%s" % device
    try:
        module = importlib.import_module(name)
        runtime = getattr(module, function_name)
        runtime_dict[device] = runtime
    except (ModuleNotFoundError, AttributeError) as err:
        runtime_dict[device] = None
        print('!!!name: %s   device: %s' % (name, device))
        print('@@@Error message: %s' % err)

I would like to know what caused your import fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants