Comments (4)
In Legion, we are very particular about data is managed. In particular, we want all data to be stored in logical regions and not in any third-party data structures like thrust vectors. Once it's out of our control, we can't reason about it and that can lead to problems. In this specific case, there is another issue: we actually don't allow Legion GPU tasks to do anything other than launch kernels (all data movement to and from the GPU should be done via the placement of physical instances in GPU memories through the mapping interface). You may have noticed that the Legion build system only links against '-lcuda' and not '-lcudart'. We do this intentionally, so we can scope exactly the set of CUDA functions that users are permitted to invoke without interfering with the Legion programming model. I'm actually not sure how you managed to get thrust to link with our Legion build system since thrust requires '-lcudart'.
from legion.
Does this mean that you do not plan to support Thrust and other similar libraries?
from legion.
We will support a specific subset of thrust that plays nice with Legion. For example, once you've got a physical instance of a logical region in framebuffer memory, Legion can provide you a raw device pointer to that instance. You can then wrap this device pointer in a thrust vector and use thrust calls to launch kernels on the vector (be sure the vector doesn't have an allocator associated with it so thrust doesn't try to reclaim the memory after the handle goes out of scope or bad things will happen). Legion will actually modify the kernel launches underneath of the CUDA runtime API to properly defer them on the right streams so you don't have to synchronize before exiting your GPU task. There is a good example of that here: https://github.com/StanfordLegion/legion/blob/stable/examples/full_circuit/circuit_gpu.cu#L390-L401 Notice we don't need to synchronize with the GPU after the kernel launch; Legion handles that automatically while allowing the GPU processor to continue executing and launching more kernels.
from legion.
I've added some missing CUDA functions that thrust needs for most of its kernel calls. There is now an example program showing how to use thrust with Legion.
https://github.com/StanfordLegion/legion/tree/master/examples/thrust_interop
from legion.
Related Issues (20)
- Legion: profile mpi handshake HOT 5
- [UBSAN] `VirtualChannel::package_message()`: store to misaligned address HOT 2
- Legion built without zlib generates uncompressed logs without warning HOT 2
- Profiler: Show "truly-in-use" memory usage line
- Performance degradation when using compact instances HOT 4
- Add online hang detection in Realm HOT 2
- Barrier Profiling HOT 4
- Fuzzer: multiple failure modes with DCR HOT 2
- `MemoryManager::GarbageCollector::perform_collection()` Use after free HOT 1
- Fuzzer reproduces low-probability Realm crashes on Sapling HOT 2
- Learning about point tasks in a process HOT 9
- Unify most processor kinds HOT 4
- [BUG] `Realm::Logger`: `malloc()` allocates, `delete` deletes. HOT 4
- Realm: GASNet wrapper reverted CMake build HOT 1
- Crash in resilient test program on multiple nodes HOT 2
- Crash in resilient Circuit on multiple nodes HOT 2
- Crash in set_garbage_collection_priority in resilience test HOT 3
- Crash in Realm::PosixAIORead::check_completion in resilience test HOT 23
- [BUG] `Realm::RuntimeImpl::network_init()` leaks `argv` HOT 3
- HTR failure on lassen HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from legion.