News for hackers. Stuff that matters.

crazyguitar

Show HN: Nvshmem from Scratch – RDMA, GPUDirect, and GPU Networking Demystified

https://cppcheatsheet.com/notes/blog/nvshmem.html

I wrote a guide that walks through building a minimal GPU-initiated networking library from the ground up. It covers RDMA transport with libfabric on AWS EFA, PCIe topology-aware GPU-NIC placement, GPUDirect RDMA via DMA-BUF, CUDA IPC for intra-node NVLink transfers, and the symmetric memory model that ties it all together. Each section includes working code and benchmarks.

( Read More... | no comments | on HN )
Thank you for sharing this excellent resource! You make a great point—searching for "modern C++" often surfaces C++11-era content, while newer standards have already deprecated some of those "modern" practices. That's exactly why I created this project: to continuously update and document contemporary best practices as the language evolves. I'll definitely check out the linked rant for ideas to incorporate. Thanks for the suggestion!
Thanks. This is a awesome suggestion. Will dive deep what is the better way to do.

Show HN: C/C++ Cheatsheet – a modern, practical reference for C and C++

https://github.com/crazyguitar/cppcheatsheet

Hi HN,I’m the creator of C/C++ Cheatsheet — a modern, practical reference for both C and C++ developers. It includes concise snippet-style explanations of core language features, advanced topics like coroutines and constexpr, system programming sections, debugging tools, and useful project setups. You can explore it online at https://cppcheatsheet.com/.I built this to help both beginners and...

( Read More... | 6 comments | 3 points | on HN )

Show HN: Libefaxx – A Microbenchmark for AWS EFA GPU/CPU RDMA Communication

https://github.com/crazyguitar/Libefaxx

I’m sharing Libefaxx, an open-source microbenchmark for AWS Elastic Fabric Adapter (EFA) focused on GPU/CPU RDMA communication.Most existing benchmarks (e.g., nccl-tests, NVSHMEM) measure collective libraries, which makes it hard to isolate raw EFA transport performance. With growing interest in GPU-Initiated Networking (GIN) (e.g., Deep-EP), we wanted a way to directly measure EFA latency,...

( Read More... | no comments | 2 points | on HN )
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @07:16PM (#22454193)
I understand you are worried about newbies misuse APIs. You remind me that I should add a warning to inform the sample code in this article should not use in programs. Thanks.

Also, I did not advocate a newbie should start and stop threads by themselves. I want to say I agree that we should use high-level APIs in most cases, but, in some cases, we may need to use low-level APIs to achieve our missions. I am unwilling to limit what kind of APIs should use. In my opinion, like you said: "you have just seriously over-architected the solution," we should be careful to use APIs. Even though high-level APIs are safer, programmers may misuse them.

Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @06:52PM (#22454085)
I think this is not an excellent solution. You have to wait for all threads finish. I agree that we should use high-level API in most of the time, but, in some cases, we still need low-level APIs to support us to reach some goals.
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @11:24AM (#22451308)
I agree with you. We should use a reliable library, as you said. The primary purpose of this article is to help people understand what a coroutine and an event loop are. Therefore, programmers can use asyncio API fluently without misuse.

However, I don't think use threads/processes is a bad idea. A pool gives you a constrain to utilize threads/processes, but sometime we may want to adjust the number of threads/processes based on system load. Under this circumstance, using a pool is not the best choice.

Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @03:53AM (#22449690)
I think the syntax, `yield from`, and `@coroutine` are two things. `async def` + `yield from` means we delegate generator to another generator. Therefore, in the async function, using `yield from` is equal to declare an asynchronous generator function.

However, using `@coroutine` + `yield from` means we transform a generator into a generator coroutine. Because a generator is a form of coroutine, in Python 3.4, `@coroutine` turns a function or a future into a generator function. Note that if a function is a generator function, `@coroutine` does not do anything. Based on the document, Python recommends using `async def` instead of `@coroutine` to declare a coroutine because `@coroutine` will be removed in Python 3.10.

Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @02:07AM (#22449387)
Oh! sorry! thx
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @02:03AM (#22449378)
Yeah! I know that @coroutine and yield from are deprecated. This article focuses on how coroutines cooperate with event loops in Python. You remind me that I should add a warning to inform your information. Thanks.
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @01:56AM (#22449351)
Oh! I understand. You're right. Some descriptions mix coroutines and event loops together. thx
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @12:50AM (#22449150)
Nice. Thanks
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @12:45AM (#22449134)
Awesome! Thank you
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @12:12AM (#22449005)
I understand. I will review my contents persistently. BTW, if you are available, could you give me some writing tips? Thank you so much.
Re:A Hitchhiker’s Guide to Asynchronous Programming on Saturday February 29, 2020 @12:08AM (#22448991)
async/await is a better design pattern without considering low-level APIs such as epoll. It is not a new kind of threading/loop. Python provides a user-level scheduler for developers, so they don't need to implement their scheduler from scratch. In my opinion, the reason why using an event loop can acquire better performance is to decrease the number of times to lock some critical sections. Also, this pattern can increase the cache hit and mitigate CPU context switch frequency.
Re:A Hitchhiker’s Guide to Asynchronous Programming on Friday February 28, 2020 @11:02PM (#22448726)
I agree.