- Podcasts
- ADSP: Algorithms + Data Structures = Programs
- Episode 83: 🇺🇸 ARRAY 2022, mdspaces, & More!
Episode 83: 🇺🇸 ARRAY 2022, mdspaces, & More!
ADSP: Algorithms + Data Structures = Programs
- June 24, 2022
- 32 min
About this episodeIn this episode, Bryce and Conor talk about Bryce’s ARRAY 2022 Keynote talk, mdspaces and more! Twitter ADSP: The Podcast Conor Hoekstra…
In this episode, Bryce and Conor talk about Bryce’s ARRAY 2022 Keynote talk, mdspaces and more!
Show Notes
Date Recorded: 2022-06-13
Date Released: 2022-06-24
- PLDI 2022
- ARRAY 2022
- Bryce’s ARRAY 2022 Keynote Talk (not online yet)
- Conor’s ARRAY 2022 Talk (not online yet)
- C++23 std::mdspan
- C++23 std::mdarray
- C++23 extents
- ArrayCast Episode 28: Rank and Leading Axis Theory
- ArrayCast Episode 29: Transpose
- J |. (transpose)
- Dyalog APL ⍉ (transpose)
- BQN ⍉ (transpose)
- All PowerPoint ShortcutTools 3.0 Keyboard Shortcuts
- PowerPoint Morph Transition
- Reddit: CPP Cast is over, what are you all listening now?
- CppCast Podcast
- cpp.chat Podcast
- NDR Podcast
- TLB hit 💥 Podcast
- Two’s Complement Podcast
- Magic Read Along Podcast
- Apple Keynote Magic Move
- Great Impractical Ideas in Computer Science: PowerPoint Programming
- CppNorth Conference
Intro Song Info
Miss You by Sarah Jansen https://soundcloud.com/sarahjansenmusic
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: http://bit.ly/l-miss-you
Music promoted by Audio Library https://youtu.be/iYYxnasvfx8
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Episode 83: 🇺🇸 ARRAY 2022, mdspaces, & More!
The other one, the other comment though, that I just find hilarious is that uh it was the criticism that our podcast uh lacks structure. Welcome to ADSP the podcast episode 83, recorded on June 13th, 2022. My name is Connor, and today with my co-host Bryce, we talk about Bryce's array 2022 keynote talk, empty spaces, and more.
Oh yeah. The reason I'm thinking it was 2019 is because in a talk that I gave, I showed a photo of Dublin being like, oh yeah, Bryce were here. But it was actually, it was it was a year later that I was, and I think it was meeting C and it was an online presentation. And I said almost one year ago was when this photo was taken of Bryce and I, who big announcement.
Honestly, I'm very happy we live in separate cities. I mean, not not in general. Wow. Not not like it would be nice if we were in the same city, but for the sake of this podcast, I don't know if I could handle doing this on a regular basis. Just standing. There's too much eye, there's way too much eye contact. I'm just not used to the and that's the thing, is I'm I'm usually this close to the mic, but here, because of my uncomfortability, I'm coming in, we're going out, and then this is great.
All right. Real expression of creativity there, but okay. But here, yes, we uh just finished attending the array workshop. So the way PLDI, for those that uh aren't regular listeners or have forgotten or aren't aware, it's the program language design and implementation conference. It's actually starting on Wednesday. So Wednesday, Thursday, Friday is PLDI, and then the Monday and Tuesday, and a little bit Wednesday as well, are co-located workshops. So I think there's a three-day PLMW, which is the programming language mentorship workshop, and that focuses on technical research, blah, blah, blah. There's a bunch of other workshops, but the workshop that Bryce was keynoting at and I was speaking at was the array workshop. How'd that go, Bryce?
Oh, definitely baseline introvert. People don't believe me. Yeah, everyone say they don't believe me, but that's the thing. It's it's where do you like what's your recharge method? Is it like being out with people and socializing and having conversations, or is it like either with a book or at your computer? And like hands down for me, it's like in front of a keyboard in front of my computer. And if like I go on vacation for a week and I don't have like I've got spreadsheets and publisher schedule and things that I like to update daily, like little graphs, you know, diet stuff. And if I go too long without updating that, like it starts to give me anxiety because I know that like seven days from now I'm gonna have to go and like try and backfill everything that I missed, and the whole life gets out of whack. I run my life on spreadsheets, and like if I don't, if I'm not able to update that. But I mean, I'm a very extroverted introvert.
I used to think that I was uh that I was an introvert, and then recently some people close to me have pointed out that I am in fact the most extroverted person that they know. I am trying to get my flight back upgraded, and we're waiting here on the live chat from the airline to see whether it can happen. And and it's just the suspense is killing me. It's killing me.
A lot of technical difficulties. Not no shade on Z, who is a professor at uh Carnegie Mellon, who's running the morning session of Array. He had nothing to do with it, but they started trying to set up the technical live YouTube stream, slash gather stream, slash whatever, like two minutes before the hour when Bryce was supposed to start speaking, and it didn't get didn't take off until 9.23. And then uh Connor knows exactly.
And Connor Connor kindly timed my talk, so it took 56 minutes. Yeah, just it's like I never I like these days I don't really rehearse my talk ahead of time. I just like sort of like intuitively know like what I'm gonna say and like how long it's gonna take. But it always surprises me how like how on target I am. For I was like, this is roughly an hour of content, and I clocked in at or no, I think I gave him the estimate before the talk. I think this is gonna be 50 minutes or so, and I clocked in at 56 minutes.
Yep, it was quite impressive. Yeah. Do we want to talk? I mean, we'll we'll link it, it'll be online by the time this airs in probably a week and a half from today. It's June 13th. This will probably air, yeah, two Fridays from now. Um do we want to talk about MD spaces? Did you just did you just come up with this like in the last four days?
Well, the basic premise of my of my talk, the back half of my talk, is that uh uh iterators are a bad abstraction for multi-dimensional iteration. Um and uh that maybe we need new a new abstraction. Um and so the abstraction that I came up with is sort of like uh an extension of ranges, but for multiple dimensions. And so I'm calling it spaces. And the idea is that you have a um uh you know, you you can call begin and end on a range, but on a space you can call md begin or md end on it. And um when you do that, you give it as a template parameter the extent which you're calling it upon. And then that returns you an iterator over that extent. And when you call md begin and md end, you can feed into it a tuple of stuff, sort of arbitrary stuff. And the idea is that that is how the outermost loops pass things to the innermost loops. So like the outermost loop um, you know, is just gonna be like an iterator over maybe indices, you know, of ints. And so then you take those that those that int and then you feed it into the m begin in md begin and md int call for the next innermost loop. And that means that that next innermost loop um uh has access to that um uh you know, to whatever iteration it's in, the the index of the iteration that it's in in the outermost loop. And so from that you can sort of incrementally build up the uh the final uh uh index that your iterator is gonna that the iterator in the innermost loop is going to return. Um and so I think it's a kind of clever little protocol. Um and uh I prototyped a library-based for each equivalent for it. Um and uh I imagine that we could have a uh sort of a space-based for loop, just like how we have a range-based for loop that understands this protocol. Um and I also think that it's uh it's a model that'll be composable too, because we could make it pipeable. We can make spaces pipeable just like ranges. Um and the default would be that you could pipe in range adapters and those would operate on the innermost iterator, but you can also imagine having some new adapter, like let's call it on extents, that would say, hey, I want to apply this particular transformation to just one of the particular extents. Um, and through that way you can get to a uh a nice compositional model. And I think that this this model will let us uh uh let us get good code gen, but also have all the properties that we're looking for, like composability and uh an ability to uh to write uh generic uh multidimensional code um and that's gonna be you know rank agnostic and location agnostic and layout agnostic, etc.
Yeah, we should dedicate a whole episode or maybe two in the future to not necessarily diving into details, but talking about MD Span, because I feel like the direction that this podcast is going and my work's going and your work's going is like MD MD Span is gonna start to come up a lot more. But without diving into a complete explanation or high-level view, uh extent. Um because that was something for a while I didn't I didn't get what that was. Would you like to explain to the listener?
Colloquially it's referred to as dimension, but in the array world and array languages, they refer to them as axes. And that's actually we kind of talked about that one or two episodes ago. Um, I think it was last episode, which actually hasn't been released yet. Well that it'll be coming out this Friday, but listeners already listened to it potentially a week ago. And yeah, so to rephrase it in like array language speak, when you have a matrix, aka a rank two array, aka a two-dimensional array, you have two dimensions or two axes, the first and the second, or zero and one. And so in Bryce's talk, uh you'll see a lot of code that is, you know, has on extent and then zero, one, or two. And it's very thought provocative because this is actually we're gonna have to bring Marshall on because I mentioned in the most recent ArrayCast episode, I talked about the evolving Connor and Bryce uh cinematic podcast cinematic universe. Because now we're gonna have uh panelists from ArrayCast coming on ADSP. We got my third podcast coming out, which I still haven't recorded my first episode for. So it's gonna get complicated, folks. We're not talking Game of Thrones complicated, but it is gonna get complicated, and there's gonna be people crossing, you know, podcasts. We'll bring Marshall on. But the most recent episode we talked about on Arraycast was how you only get a certain amount of access uh to drilling down using this leading axis theory uh so you can operate on a certain rank, but you might have to reshape your data in order to specifically work on a specific specific chunk. And you then need something called a dyadic transpose. So, like a transpose of a matrix, 2D matrix, pretty straightforward. But what if you have a uh 3 or n-dimensional array that is more than just a matrix? What does a transpose look like there? Interestingly, it's like different across the array languages. In APL and J, I believe they just reverse the shape. So if you have a cube and the dimensions are two, three, four, you just reverse it and it becomes four, three, two. In BQN, they do a one rotate, so they take the first dimension and move it to the back. But more specifically, you can do like any arbitrary, arbitrary uh reshape, which is what a dyadic transpose is. It's a transpose that takes two arguments, like your matrix, and then this new, basically like grade, if you will. So it's the reordering of the axes, aka extension, md span speak. And now you're talking about this like new potential model, and they're completely different. And I don't understand yours well enough, but definitely you could do everything you can do with dyadic trans. I think like they're probably isomorphic, but admittedly, array people they talk about dyadic transpose as being like one of the most complicated things. And my question is like all of this complexity, obviously, there's a certain set of problems that necessitates you being able to do this stuff, but is this like is this mostly driven by industry problems? Like an HPC, you've got a bunch of stuff that requires this, like woo-woo, extent, extent, dot, dot, shape, shape. Or is it like the hardware that, you know, and and having to do like efficient algorithm implementation with tiling and stuff?
Multidimensional um uh multidimensional spaces are logical, not physical in hardware. Um in okay, but it's on GPUs there's a little bit of a notion of that, but even that is actually fit like physical, uh is that is logical not physical. Um and and like yeah when I when I say physical, I mean like physical in terms of like how processes address memory. I I do recognize that there are some types of memory that are actually like multidimensional, but but no, like normally we think of many are as uh we think of memory as like a linear you know store um uh typically. And so, you know, whatever uh multi-dimensionality we add on top of it is is a logical layer.
I guess I mean I'm not sure if that was uh I asked my question correctly, but like all of this, like the the the complexity that you uh uh uh have to introduce in order to give the user a completely generic way to drill down to like any extant or axis of some multidimensional thing. Is that like I don't know. I've yet to come across problems, but like I don't operate in the HPC space and I usually am writing libraries not using them.
I mean the the complexity of the like on the interface on like what you want to do, the complexity and like how we implement it certainly comes from the hardware, you know. Like as we discussed in my keynote today, there's you know, there are a number of sort of natural approaches to how you do multidimensional iterators in C, which just lead to terrible code gen. Um but you know, the the application problems, like yeah, they're they're they're naturally they have this structure where they have multiple dimensions.
That's what I and that's what my thought is, is that like a lot of the you know the way that at least you know it doesn't necessarily have to be GPUs, but that's what we work at NVIDIA, and that GPUs, a lot of the times if you can translate your you know matrix multiply and some some sort of tiled matrix multiply, you know, the GPU goes nom nom nom, thank you for the more food. Um but that's like that's not driven by that's not driven by some application uh level problem. It's it's this is the way the hardware works, and therefore it'd be nice if we had a generic way to write the implementation of this algorithm such that it could be tiled super like super simply.
Yeah, yeah. That's I mean i if you look at the naive way that you write a matrix multiply versus how you write an efficient matrix multiply, they're very different. And they're very different because uh, you know, the way that you write to get performance is just gonna be very, very different than the naive way because you have to think about things like locality and and uh memory access patterns.
You know, you know, you know how I do do things like that. Uh you've seen my little red boxes. I don't so so so what one of my secrets to PowerPoint is like so arrows and PowerPoints connect to shapes. Um, but they don't always connect to shapes in like useful places. Um and so like sometimes like when you're wanting wanting things to be nice and aligned, instead of just like having like arrows and lines just like you know that you try to manually align, it can be really useful to make little boxes and put them in sort of like the right places. And then those will give you, like then you can connect lines to those, and then you can make those boxes 100% transparency, um, which is not 100% transparency, is nice because it's um it means that you can put them on the top layer so you can click them and get to them if you need to move them around, but nobody can see them. And I always make these little boxes red um so that when I turn the transparency back down again, it's easy to see them. Um, so on that little 2D matrix that I had where I put the lines of the orders, in the center of each one of those matrices um is a little red box that I use to connect up the lines. Because, yes, dear listener, PowerPoint is my day job, which means I have acquired some PowerPoint skills. I don't know if we've talked about it on this podcast before, but that's the first time I've got it. No, no, no, no, the shortcut tools. Um, I had this PowerPoint plugin that I don't remember the exact name of it, but we'll put a link to it in the show notes. But this plugin's amazing because it gives you um a couple of very useful PowerPoint actions, like copy position of a thing. So instead of copying the whole thing, you just copy its position. And then you can paste the position to put some other object to the same position, which is really useful when you're trying to align things across lines. It also has key bindings for all of the alignment things, because usually you have to go into a range and then click on one of those things. I never have to do that. I just got my key bindings. I am a PowerPoint wizard. Connor's an Excel wizard. Connor's life runs on spreadsheets as he just mentioned earlier in this episode. My life runs on PowerPoint.
Yeah. I mean, well, so what you just said you have keyboard shortcuts for. I mean, this derailed. What did it actually we're gonna derail this derailment? I found that Reddit thread that you said when you mentioned that some people were saying you're too nonchalant. Uh and I so I there was a Reddit thread that was entitled CPP cast is over. What what do we listen to now? And it was basically a 50% were recommending sort of the the newer C, you know, plus because some of them talk about other things like ours. So, you know, ADSP, TLB uh hit, uh 2's compliment, NDR. So those are the sort of the four, and then there was a bunch of other ones outside of C. But then there was one comment that said, like, yeah, you know, I really like ADSP, but then there was like a bunch of responses, which in it said yes, Bryce is uh too nonchalant, but it also said that um the podcast Yeah I don't really care.
The the other one, the other comment though, that I just find hilarious is that uh it was the criticism that our podcast uh lacks structure. And um and dear listener, uh please go back to the beginning and um listen when this podcast was inspired by Magic Read Along, a 20 to 25 minute uh telephone conversation, if you will, between Dr. Boolean and I can't even remember the other because they they would never even introduce ours has an intro, little jingle. Theirs literally like it would just start, hey man, how's it going? Wouldn't say their names for like up till episode 40. I didn't even know Dr. Boolean because they never plugged their Twitter handles, they never plugged for ratings, which is why I basically said only once every 50 episodes are we gonna say go to your blah blah blah. We're not gonna do it now, and that doesn't count. Um but the point is, is like we modeled this pod I modeled this podcast off of Magic Read Along, which doesn't even um record or uh release anymore. But it was specifically the lack of structure that I liked, and so I just thought it was funny that um they're like, yeah, you know, this could could do with a little more structure. I'm not denying that our podcast probably could do it's by design that it's not there. Um back to the PowerPoint morph and so before Morph, I was gonna say the thing that you have the the things that you have key bindings for, I have um the shortcuts, so you can add little icons to uh so it's still a single click, but yeah, I have all those. Like the basically the distribute evenly and horizontally, the align left, right, center, middle, those are like bread and butter, you have to have it. And the thing today, and this is probably the number one question I've been asked post-talks. It has nothing to do with my technical content. It's always like great transitions, how do you do the thing where you get code, one piece of code to transform into another? And in uh Microsoft PowerPoint 2019 and some later editions of 2017, but usually you just want to get 2019, they added a transition called Morph. Keynote, Apple's keynote, uh the PowerPoint clone, has had something like this called magic move, I believe, for years.
All I know is keynote is they got that one animation where the text falls down and then creates a sort of little dust cloud. And I'm like, oh, that's keynote. Um because that's what they always used to do, or as Steve Jobs said, you know, they'd have some number and then it'd be 10 billion devices sold or whatever. Anyways. Morph was added, but the the key thing is that some people will try Morph and every single animation and transition, or most of them, have like uh effect properties or transition properties. And so you need to go and click on that, and there's three different ones object, words, and characters. And for code transitions, you always want to choose either words or characters, and the default is objects. So it'll actually pick out the words that are you know consistent between two slide examples. And I was telling Bryce.
That's really it must be a very, very like, and that's the thing is some people have criticized, especially when it's APL, because like it looks really nice when you have like C or Python code and it transitions because no one's gonna be able to track you know exactly what went where. It just looks nice. But with APL, sometimes you only have like four characters on the screen and then you transition. But what it does is it it finds the closest word or character. So like sometimes, especially if you're dealing with an array of ones and zeros and you're trying to like add 10 to it or something, a one that really was being turned into a two will actually slide across and become the first one in a 10. And that's not actually what you want. And you actually could have seen that in I did a first 10 odd numbers when I went from one to 10, then two to twenty, and then one to nineteen, the ones and stuff were sort of moving around, so it doesn't work perfectly, but it's basically like some kind of shortest distance algorithm to some object identifier.
A wall a wall of text is just gonna be bad. But um I'll link in the show notes. The the way I learned this was this like crazy like PowerPoint hacks, and basically what this guy was showing, the presenter, is that obviously if you've got a rectangle that turns, you know, from a purple rectangle to a blue square, it can figure that out and it'll actually transition the colors and the shape. But like if you're trying to make a star object turn into a circle, well, like those are actually two different objects. But what you can do is group groups of objects together, and then you can make one of them like the primary, there's some way to like, you know, you put a square but make it invisible, and then take a circle and a star, and then it'll it'll see that we have two bundles and they both include a square, and then they will morph like the star into the circle, and that like and he starts and he shows and so if you really take this crazy and then he builds this whole animation that looks like it was something designed in, you know, whatever, 2005 flash, uh, and uh yeah, PowerPoint. Like I said, I might not be a triple black belt.
I would love, I mean, I said this back when we did the Excel episode to bring some of the Microsoft if we happen to have any Microsoft devs that work on PowerPoint over Excel or anything in the office. I actually added a couple people on LinkedIn when I was at CPP Con 2019 because I ran into them and they were like, oh yeah, we work on Excel. And then I just lost it. I was like, I love Excel so much. I used to have three versions of it.
Yeah, we can do it. So, like, Tony's gonna be at CPP North. Uh, so is Titus. I think Chandler's gonna be there as well. And uh Sean, parents are also gonna be there. Anyways, we got a bunch of people that have been on our list of people to talk to. You said you want to bring Titus on. Yeah. I said I wanted to bring Sean and Tony. Maybe we could have a big uh maybe do you think Chandler and Titus would come on at the same time? Yeah, sure, why not? Anyways. Two for the price of one. I think Sean and Tony are the well, actually, that was half the people I just listed.
