Live data from Hacker News

Tales of the M1 GPU

asahilinux.org

371–380 of 390 posts

Re: Tales of the M1 GPU

#371
post #262

Earlier quoted context omitted.

In C? No, not unless you write your own scaffolding to do it. In C++? Maybe, but you’d need to make sure you stay on top of using thread safe structures and smart pointers. What Rust does is flip this. The default is the safe path. So instead of risking forgetting smart pointers and thread safe containers, the compiler keeps you honest. So you’re not spending time chasing oddities because you missed a variable initia…

> What Rust does is flip this. The default is the safe path. So instead of risking forgetting smart pointers and thread safe containers, the compiler keeps you honest. For what it’s worth, the same is true of Swift. But since much of the original Rust team was also involved with Swift language development, I guess it’s not too much of a surprise. The “unsafe” api requires some deliberate effort to use, no accidents a…

I have such a love hate relationship with Swift. It genuinely has some great ergonomics and I see it as a sister language to rust.

I just wish it was more cross platform (I know it technically works on Linux and windows…but it’s not a great experience) and that it didn’t have so much churn (though they’ve stopped futzing with the core components as much with Swift 4+).

I also wish it was faster. I did an Advent of Code against some friends. I picked Rust, they picked Swift. The rust code was running circles around their Swift ones even when we tried to keep implementations the same.

Anyway, that’s a rant, but I think to your point, I feel like Swift could have been as big as Rust..or bigger given the easier use, with many of the same guarantees. I just wish the early years were more measured.

Re: Tales of the M1 GPU

#373

Earlier quoted context omitted.

There are 149 exclamation points on that page (!)

Would that not mean general excitement on the part of the author? I find it hard to analyze these things by numbers alone. It's context that really matters and if there truly is a baseline excitement, there really should be a high number of exclamations.

It can in moderation, but there's a phenomenon that people (often women) in communications overuse exclamation points, trying to come across as friendly and not assertive [1][2]. It's something I've noticed in my professional career, and not me trying to make a stereotype. You start to tip that usage too far, like 149 of them in a technical document, and it detracts from your content.

>A bunch of shader cores, which process triangles (vertex data) and pixels (fragment data) by running user-defined programs. These use different custom instruction sets for every GPU!

Why are different instruction sets exciting to the author? What does exclaiming that fact really mean for me as the reader? What I got out of it was the author was so surprised by this basic fact, that it was so out of this world unbelievable, that we also must be surprised by it. I'd rather read technical explanations with leadership/competence.

[1] https://www.linkedin.com/pulse/women-exclamation-points-emil...

[2] https://onlinelibrary.wiley.com/doi/full/10.1111/j.1083-6101...

Re: Tales of the M1 GPU

#374
> It feels like Rust’s design guides you towards good abstractions and software designs.

> The compiler is very picky, but once code compiles it gives you the confidence that it will work reliably.

> Sometimes I had trouble making the compiler happy with the design I was trying to use, and then I realized the design had fundamental issues!

I experience a similar sentiment all the time when writing Rust code (which for now is admittedly just toy projects). So far it's felt like the compiler gives you just enough freedom to write programs in a "correct" way.

I don't really do unsafe/lower-level coding, so I can't speak to much there however.

Re: Tales of the M1 GPU

#375

Earlier quoted context omitted.

I like your optimism, but it seems more like a Phillip K. Dick novel to me. >In 2021, society is driven by a virtual Internet, which has created a degenerate effect called "nerve attenuation syndrome" or NAS. Megacorporations control much of the world, intensifying the class hostility already created by NAS. from Johnny Mnemonic What can we do to make it more utopian?

> What can we do to make it more utopian? Move to Mars and start over.

Not falling for it! I’ve seen Total Recall! Based on an actual Phillip K. Dick story.

I have no hope that would work or is what Elon wants. I know he wants to set up the world’s most exclusive gated community there.

Re: Tales of the M1 GPU

#376
post #120

Earlier quoted context omitted.

In https://asahilinux.org/2022/03/asahi-linux-alpha-release/ it says that 4k pages work on the HW but 16k has tome advantages. Dropping 4k page size supporrt would imply a departure from arm architecture compatibility compatibility I think, it might have also nontechnical problems (ARM license).

The arm spec allows to have machines that implement any of 4KB, 16KB, or 64KB granules or any combination thereof. Apple shipped plenty of phone SoCs that didn’t support 4KB pages for the CPU (A9->A13).

Interesting - at first this didn't seem to be detailed in the popular (Wikipedia etc) or ARM web pages I could find but it seems it was about terminlogy, "translation granule" was the right one and then you can find mentions like "The granule sizes that a processor supports are IMPLEMENTATION DEFINED".

Re: Tales of the M1 GPU

#377
post #371

Earlier quoted context omitted.

> What Rust does is flip this. The default is the safe path. So instead of risking forgetting smart pointers and thread safe containers, the compiler keeps you honest. For what it’s worth, the same is true of Swift. But since much of the original Rust team was also involved with Swift language development, I guess it’s not too much of a surprise. The “unsafe” api requires some deliberate effort to use, no accidents a…

I have such a love hate relationship with Swift. It genuinely has some great ergonomics and I see it as a sister language to rust. I just wish it was more cross platform (I know it technically works on Linux and windows…but it’s not a great experience) and that it didn’t have so much churn (though they’ve stopped futzing with the core components as much with Swift 4+). I also wish it was faster. I did an Advent of Co…

>The rust code was running circles around their Swift ones even when we tried to keep implementations the same.

I've done Advent of Code a few years -- even Javascript implementations, if using a good (optimal) algorithm, are highly performant, so I'm suspicious of the claim. In most AoC problems, if your code is observably different between languages, it's the fault of the algorithm, regardless of language. But perhaps you are referring to well-profiled differences, even if there are no observable differences.

That said, in projects other than AoC I've compared Swift to C++ and it's hard to deny that a low-level language is faster than Swift, but Swift itself is certainly fast compared to most dynamically typed or interpreted languages like Python, JS, Ruby, etc. which are vastly slower than anything in Swift.

Re: Tales of the M1 GPU

#378

Earlier quoted context omitted.

> But closing your eyes and pretending everything is a file is a security disaster waiting to happen (actually, happening every day). What is this in response to? GP never mentioned file interfaces.

Sure they did, they talked about the abstractions present in Linux.

I'd like to know why they believe this.

Re: Tales of the M1 GPU

#379

Earlier quoted context omitted.

Would that not mean general excitement on the part of the author? I find it hard to analyze these things by numbers alone. It's context that really matters and if there truly is a baseline excitement, there really should be a high number of exclamations.

It can in moderation, but there's a phenomenon that people (often women) in communications overuse exclamation points, trying to come across as friendly and not assertive [1][2]. It's something I've noticed in my professional career, and not me trying to make a stereotype. You start to tip that usage too far, like 149 of them in a technical document, and it detracts from your content. >A bunch of shader cores, which…

These meta discussions can be illuminating.

The intent I got was the idea of all the GPU instruction sets being different is notable, and perhaps unexpected and at the least challenging. The latter being an exclamation in the context of reverse engineering makes some degree of sense to communicate the fundamental difficulty inherent in this effort.

Now, we could go back and forth a few more times, invite friends and curious others to the party and end up with many different takes on this text.

What's the takeaway?

For me, it's lack of judgement. Content is king. I want to know what others mean to say and how they feel about it. I don't want to judge them on those things because what exactly is the point?

Make things better for me?

...better for people like me?

...people in general? Doubt that given the diversity of takes the experiment above would generate.

Waste of time. That's the takeaway.

And to press that idea home somewhat more, when I talk to other people, not text, but talking, I find diversity beautiful. Some are stoic. Some are bitter, jaded well worn solders. Others are excitable. Funny? Yup.

I submit you cost yourself more wondering why they don't conform than ever getting the answer is worth. Further, taking their intent in a more liberal, forgiving sense will get you to the good stuff others intend to share more quickly and efficiently. Plus, you might laugh a little.

I do. And it's enjoyable.

When I read the piece, I enjoyed feeling a bit of the joy, excitement, frustrations experienced by the authors and that amplified the good in all of it a little. Great! They did have one heck of an adventure after all.

Finally, you mention women overusing exclamation points. Maybe they are just being women? Just putting that out there.

I am pretty sure if we were to take a poll of those of us who are women as to whether being one is OK would trend to a definitive yes. The ones I know well tend to have a lot of fun and more colorful, rich relationships too. Kind of envy that personally.

I think it is OK to be a woman. After all, being a guy, I tend to be a guy. Why would women play it any differently?

Thoughts for you to consider.

Cheers! <-- Exclamation intended to convey a general upbeat mood, hoping it's catchy.

Re: Tales of the M1 GPU

#380
post #371

Earlier quoted context omitted.

I have such a love hate relationship with Swift. It genuinely has some great ergonomics and I see it as a sister language to rust. I just wish it was more cross platform (I know it technically works on Linux and windows…but it’s not a great experience) and that it didn’t have so much churn (though they’ve stopped futzing with the core components as much with Swift 4+). I also wish it was faster. I did an Advent of Co…

>The rust code was running circles around their Swift ones even when we tried to keep implementations the same. I've done Advent of Code a few years -- even Javascript implementations, if using a good (optimal) algorithm, are highly performant, so I'm suspicious of the claim. In most AoC problems, if your code is observably different between languages, it's the fault of the algorithm, regardless of language. But perh…

Swift is fast but it’s both easy to accidentally write slow code and there is a not-insignificant amount of overhead to the reference counting and constant dynamic table lookups.

When I say Rust ran circles around it, I mean the difference was not noticeable unless timing, and was the difference of 200ms vs 400ms or a 3 seconds vs 5 seconds , so nothing to write home about necessarily.

Post reply on HN