ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
66 stars 29 forks source link

Simple Pipeline issue #76

Closed alexhege closed 2 years ago

alexhege commented 7 years ago

When running first.py

from bifrost.block import TestingBlock, FFTBlock, WriteAsciiBlock, Pipeline

my_blocks = [] my_blocks.append([TestingBlock([1, 2, 3]), [], ['my array ring']]) my_blocks.append([FFTBlock([0., 0.5, 2]), ['my array ring'], ['fft output ring']]) my_blocks.append([WriteAsciiBlock('logfile.txt'), ['fft output ring'], []]) my_pipeline = Pipeline(my_blocks) my_pipeline.main()

I crash and get as output

WARNING: Install simplejson for better performance Traceback (most recent call last): File "first.py", line 7, in my_pipeline = Pipeline(my_blocks) File "build/bdist.linux-x86_64/egg/bifrost/block.py", line 59, in init File "build/bdist.linux-x86_64/egg/bifrost/ring.py", line 38, in init File "build/bdist.linux-x86_64/egg/bifrost/libbifrost.py", line 138, in _string2space File "/home/alexhege/Downloads/casa-release-4.7.0-1-el7/lib/python2.7/site-packages/pyclibrary-0.1.4-py2.7.egg/pyclibrary/c_library.py", line 226, in getattr raise NameError(name) NameError: BF_SPACE_AUTO Exception AttributeError: "'Ring' object has no attribute 'obj'" in <bound method Ring.del of <bifrost.ring.Ring object at 0x1d75210>> ignored

MilesCranmer commented 7 years ago

Uh-oh, this looks like the older-oldfrost API! I see where this example is in the wiki docs - I will have to update it.

This bug looks real, however. I can't reproduce it on my machine, though. I see that pyclibrary is running from within a casa folder on your machine. Is that where your main python installation is? Does this bug occur every time you run the script?

Cheers, Miles

alexhege commented 7 years ago

Yes it does happen every time I run the script.

And no, the casa folder is not the main python installation (that's in my usr/bin), and I could not get bifrost to install on it, however pyclibrary is intalled on both distributions. I'm not sure why it's looking at the pyclib in the casa python installation.

I'll try some repointing of the python binaries to get usr/bin to point to the casa python and see if that allows me to install bifrost there, and see if I still get the bug.

Thanks, Alex

On Thu, Mar 2, 2017 at 9:49 PM, Miles Cranmer notifications@github.com wrote:

Uh-oh, this looks like the older-oldfrost API! I see where this example is in the wiki docs - I will have to update it.

This bug looks real, however. I can't reproduce it on my machine, though. I see that pyclibrary is running from within a casa folder on your machine. Is that where your main python installation is? Does this bug occur every time you run the script?

Cheers, Miles

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ledatelescope/bifrost/issues/76#issuecomment-283850373, or mute the thread https://github.com/notifications/unsubscribe-auth/AQJGVSXccaaLp5kca1XlXYNegPMO-Sj2ks5rh3_DgaJpZM4MRvno .

-- Alexander Hegedus PhD Candidate Department of Climate and Space Sciences and Engineering (CLaSP) The University of Michigan alexhege@umich.edu

benbarsdell commented 7 years ago

Can you try running the following in a Python terminal:

>>> from bifrost.libbifrost import bf
>>> bf.Memcpy
>>> bf.BF_SPACE_AUTO

It could be that it's not finding the right bifrost headers (which should be in /usr/local/include/bifrost/).

alexhege commented 7 years ago

I crash on bf.Memcpy returns

Traceback (most recent call last): File "", line 1, in File "/home/alexhege/Downloads/casa-release-4.7.0-1-el7/lib/ python2.7/site-packages/pyclibrary-0.1.4-py2.7.egg/pyclibrary/c_library.py", line 226, in getattr raise NameError(name) NameError: Memcpy

My /usr/local/include/bifrost has address.h array.h cuda.h fft.h quantize.h transpose.h udp_socket.h affinity.h common.h fdmt.h memory.h ring.h udp_capture.h unpack.h

repointing my /usr/bin/python did not help

On Sat, Mar 4, 2017 at 3:28 PM, Ben Barsdell notifications@github.com wrote:

Can you try running the following in a Python terminal:

from bifrost.libbifrost import bf bf.Memcpy bf.BF_SPACE_AUTO

It could be that it's not finding the right bifrost headers (which should be in /usr/local/include/bifrost/).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ledatelescope/bifrost/issues/76#issuecomment-284178549, or mute the thread https://github.com/notifications/unsubscribe-auth/AQJGVbIjSA3nV3dIQp-rTpTWntKA6oLLks5riclTgaJpZM4MRvno .

-- Alexander Hegedus PhD Candidate Department of Climate and Space Sciences and Engineering (CLaSP) The University of Michigan alexhege@umich.edu

benbarsdell commented 7 years ago

@alexhege how do things look with the latest code? A lot of changes have been made in the past 6 months, including the removal of pyclibrary.

alexhege commented 6 years ago

So after some headaches, this is what I've got:

I can make and install it with no errors

My setup is in attached user.mk My GPU is a NVIDIA Quadro K2000 https://en.wikipedia.org/wiki/Nvidia_Quadro https://www.techpowerup.com/gpudb/1838/quadro-k2000

Running on CUDA version 3.0, and 2048 MiB memory size

But running 'make test' shows some things wrong.

test1.out is the output of make test with all code untouched. It hangs on the first test due to crashing in DataTypes.py 'AttributeError: 'numpy.dtype' object has no attribute 'ndim' '

I fixed this by adding a couple lines to DataTypes.py around line 134, checking if hasattr(t, 'ndim') is true. This seems to fix most of the errors, at least allowing make test to complete.

test2.out is the output of 'make test' after this change.

"...

Ran 197 tests in 220.236s

FAILED (failures=1, errors=4, skipped=3)"

I'm less sure how to fix these

But the code now can do simple stuff without crashing, like second.py, an early simple pipeline. Also it can do things it couldn't before, like

from bifrost.libbifrost import bf bf.bfMemcpy <_FuncPtr object at 0x892050> bf.BF_SPACE_AUTO 0

So how should I proceed from here?

On Sat, Oct 7, 2017 at 3:41 PM, Ben Barsdell notifications@github.com wrote:

@alexhege https://github.com/alexhege how do things look with the latest code? A lot of changes have been made in the past 6 months, including the removal of pyclibrary.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ledatelescope/bifrost/issues/76#issuecomment-334961009, or mute the thread https://github.com/notifications/unsubscribe-auth/AQJGVbUPVRFbEZq1Bf6f2PaDb7fmYV7nks5sp9PqgaJpZM4MRvno .

-- Alexander Hegedus PhD Candidate Department of Climate and Space Sciences and Engineering (CLaSP) The University of Michigan alexhege@umich.edu

MilesCranmer commented 6 years ago

Hi @alexhege, we have only used CUDA 8 with Bifrost, so I highly doubt CUDA 3 will work (sorry for not including this in the docs, I have just added it). Could you update your CUDA version? Let me know how that goes for you.

Cheers, Miles

alexhege commented 6 years ago

My K2000 GPU has a 'CUDA Compute Capability' of 3.0 (corresponds to the GPU_ARCH in user.mk I believe), but I've always been using nvcc from cuda 8.0

On Tue, Nov 14, 2017 at 6:10 PM, Miles Cranmer notifications@github.com wrote:

Hi @alexhege https://github.com/alexhege, we have only used CUDA 8 with Bifrost, so I highly doubt CUDA 3 will work (sorry for not including this in the docs, I have just added it). Could you update your CUDA version? Let me know how that goes for you.

Cheers, Miles

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ledatelescope/bifrost/issues/76#issuecomment-344431093, or mute the thread https://github.com/notifications/unsubscribe-auth/AQJGVQl2gjcpeWciYLA6bpQJ3f0hx5Ksks5s2h3dgaJpZM4MRvno .

-- Alexander Hegedus PhD Candidate Department of Climate and Space Sciences and Engineering (CLaSP) The University of Michigan alexhege@umich.edu