We cannot consume every piece of the planet and leave nothing for other species, and there are already far more of us than necessary.
680 karma · joined May 19, 2020
We cannot consume every piece of the planet and leave nothing for other species, and there are already far more of us than necessary.
SSE4 is from 2008, so making it a requirement isn't unreasonable.
Even AVX2 is from 2013, so some apps require it nowadays.
It is extremely difficult for a compiler to convert scalar code to SIMD automatically, even static C++ compilers really suck at it.
A dynamic compiler for javascript would have no real hope of any meaningful gains.
The strlen could be made safe by having the malloc return the address 100 bytes before the end of the page. If it did make it to the end of the 100 bytes it would fall over safely. Result would be nonsense of course. Of course if you read bytes < than the returned ptr you would have 4k-100 bytes before it fails on bad page.
Also the 9950x has 32 threads, but is hyperthreaded, so it only has 16 actual cores, so the correct scaling factor is 16 cores * 16 SIMD lanes. Anyway the final number is 8.678 32 bit float TFLOPS.
The RTX 4090 has 82.58 32 bit TFLOPS according to Nvidia, but it also costs far more than the 9950x($1,600 vs $650), so I find this comparison rather odd.
So it costs 2.46 as much and delivers 9.5x the perf.
If you normalize for cost the perf advantage is about 3.8x, which is roughly the same numbers Intel reported years ago when they debunked the whole GPU is 100x better nonsense.
Anyway, I really hate the Cuda terminology where they refer to SIMD lanes as "threads".
There are also alot of the things to consider, where either the CPU or GPU has an advantage such as..
GPU advantages:
Hardware sin/cos support(with Nivida at least)
abs/saturate are often just modifiers
scaling by small powers of 2 is often free
16bit floats are fully supported
CPU advantages:
doubles are full speed and you can interleave with floats if you just need for a few calculations
access to wide variety of integer sizes and bit manipulation functions, GPU has some of this but not nearly as broad
lower level programing model
Iterative C++ compile times can be very fast if you know what are you doing, 17 seconds is very long unless you have link time optimizations on(which makes no sense for an iterative build).
I'd prefer a 1 per byte entry option for higher detail, no need for any fancy modes, needs to be simply and fast to encode so it can be done realtime.
IDK about this post though, separating the block min/max into a separate memory location from the indices doesn't make much sense, you could just access a less detailed mip if that is what you want.
At least for what I use locks for, the uncontended case is like 10000x more common, I actually don't think I have any super heavy contention such as the case shown in the post, as this is simply something to be avoided--as no no matter how good the mutex this won't play well with the memory system.
And they are apparently relying on the compiler to generate it...just no.
Use intrinsics, it ant that hard.
You do know this kind of thing has zero to do with Python? Nobody is having sex at pycon? They can just do what everyone else does, and not make that the most important thing in the world while at the stupid convention.
Like personally I think logging should end, so can I just make this position a requirement that everyone else has to agree with to attend Pycon? It makes no sense, as it isn't related to the topic of the convention. I think that is why it gets labeled as an ideology.
Apple CPU's kinda suck at vector ops, but they aren't that bad, this thing is only mildly better. I would guess power savings is a big part of why they use this SVE streaming matrix mode.
1. HW does 2x2 blocks of pixels always so it can have derivatives, even if you don't use them..
2. Accessing SV_PrimitiveID is surprisingly slow on Nvidia/AMD, by writing it out in the PS you will take a huge perf hit in HW. There are ways to work around this, but they aren't trivial and differ between vendors, and you have to be aware of the issue it in the first place! I think some of the "software" > "hardware" raster stuff may come from this.
The HW shader in this demo looks wonky though, it should be writing out the visibility buffer, and instead it is writing out a vec4 with color data, so of course that is going to hurt perf. Way too many varyings being passed down also.
In a high triangle HW rasterizer you want the visibility buffer PS do a little compute as possible, and write as little as possible, so it should only have 1 or 2 input varyings and simply writes them out.
Musk may be huffing the right wing nonsense too much, but I don't know if he has actually done anything anti-american(though supporting someone as obviously corrupt as Trump could be considered so I suppose), much of the headlines about him appear to be clickbait nonsense.
SpaceX can't do jack shit without Gov approval, so it wouldn't really matter if they had ulterior motives.
You can write them yourself also but I'd add a verifier that checks the output with scalar code as it can be tricky to get correct.
Intel had an article up for the 3x8 transpose, but it seems to no longer exist so i'll just post the psuedo code
//xyz -> xxx
void swizzle3_AoS_to_SoA(v8float &x, v8float &y, v8float &z) {
v8float m14 = interleave_low_high<1, 2>(x, z); //swap low/high 128 bits
v8float m03 = blend<0, 0, 0, 0, 1, 1, 1, 1>(x, y); //_mm256_blend_ps 1 cycle
v8float m25 = blend<0, 0, 0, 0, 1, 1, 1, 1>(y, z);
//shuffles are all 1 cycle
__m256 xy = _mm256_shuffle_ps(m14, m25, _MM_SHUFFLE(2, 1, 3, 2)); // upper x's and y's
__m256 yz = _mm256_shuffle_ps(m03, m14, _MM_SHUFFLE(1, 0, 2, 1)); // lower y's and z's
v8float xo = _mm256_shuffle_ps(m03, xy, _MM_SHUFFLE(2, 0, 3, 0));
v8float yo = _mm256_shuffle_ps(yz, xy, _MM_SHUFFLE(3, 1, 2, 0));
v8float zo = _mm256_shuffle_ps(yz, m25, _MM_SHUFFLE(3, 0, 3, 1));
x = xo;
y = yo;
z = zo;
} Make float sortable as integer. (the reason you might wish to do this is that integer comparisons are faster and run on more ports, also you won't get unsortable data from NAN). You can undo the transform by calling this fxn again. You only need this with a mix of positive/negative floats, if they are all positive you can skip this.
int i = cast_int(f);
shift_right_sign_bits(i, 31) & 0x7FFFFFFF) ^ i Scale float by powers of 2
Cast a float to integer and add 0x00800000 * N(N being the power of 2). Subtract to divide. Fails with 0 value float.Not super useful unless you already have the float in the integer domain for some other reason, also integer adds/subs run on more ports and are 1 cycle.
The fast sqrt function is well known but you can do this for other powers of 2
//An approximate pow(a, 1/4)
float fastPow_1_4(float a) {
return asfloat((asuint(a) >> 2u) + 798700996u);
}//An approximate pow(a, 1/8) float fastPow_1_8(float a) { return asfloat((asuint(a) >> 3u) + 931853847u); }
//An approximate pow(a, 1/16) float fastPow_1_16(float a) { return asfloat((asuint(a) >> 4u) + 998350438u); }
//An approximate pow(a, 1/32) float fastPow_1_32(float a) { return asfloat((asuint(a) >> 5u) + 1031705320u); }
They are very low accuracy as they don't have a newton raphson step, and were just intended for stuff like graphics where accuracy isn't always important.
The other problem with simd is that in modern cpu-centric languages it often requires a rewrite for every vector width.
Nope, you can use many existing libraries that present the same interface for all sizes, or write your own(which is what I did). And for 80% of the cases by the point there is enough vectorizable data for a programmer to look into simd, a gpu can provide 1000%+ of perf AND a certain level of portability.
Transfer latency & bandwidth to GPU is horrible, just utterly horrible. And GPU to CPU perf dif is more like 5x, and in games etc the GPU is already nearly maxed out And it also takes a lot of space on your cpu die. Like, A LOT.
Relative to the performance it can offer it is a very small area. The gains in the article are small compared to what I see, probably the author is new to SIMD.*When using SIMD you must either use SoA or AoSoA for optimal performance. You can sometimes use AoS if you have a special hand coded swizzle loader for the format.