Better HN
topnewbestaskshowjobs
Log inSign up

ColonelPhantom

645 karma · joined Oct 28, 2016 (10y ago) · 374 submissions

Submissions

comment 2y ago · link · parent

> On long roads where every other country would give right of way to the long road because it works together with the natural psychology of driving on a long continuous road, in the Netherlands they will give right of way to small side streets.

Where was this? In my experience, this only applies to 'access roads', smaller roads not intended for through traffic. Roads intended to move traffic over longer distances do generally prioritize through traffic by giving right of way.

comment 2y ago · link · parent

The Max also has much more memory bandwidth. Especially for running local LLMs, that is the limiting factor much more than the number of GPU cores is.

comment 2y ago · link · parent

Firefox also has a "Copy without URL tracking" option in the URL bar context menu. It's not one-keypress, but clearly a tracker stripper is not Arc-exclusive.

Also no idea what you are talking about with Zen's "Mozilla underpinning sabotaging the experience".

comment 2y ago · link · parent

It's not nonsense; the point is that calling a Numpy function needs to be done from Python. You cannot pipe stdin to np.array().

comment 2y ago · link · parent

I find the word 'homoiconic' very hard to define anyway. For example, I think Tcl is also often described as homoiconic, which manifests in being able to make e.g. custom control structures (https://wiki.tcl-lang.org/page/code+is+data) although something like Haskell also deals with that quite well. However, in say Javascript, you would need to use special syntax when using every {} so that the block content can be seen (e.g. by wrapping it in a function, or passing it as a string to be eval()ed).

In the case of Unix, the question is probably "what is the canonical representation of executable code". I think the author's intent was to mostly talk about shell scripts, and not something like C code. Manipulating shell scripts via e.g. sed is, I think, pretty doable.

I'm also a bit confused why homoiconicity needs to be convenient to be real. Most people don't find shell a very convenient language in other aspects, either.

comment 2y ago · link · parent

I believe most newer x86_64 patents are held by Intel (e.g. AVX). As such if Intel is taken over they would still hold them, right?

67.

Tinylangs: Programming languages in 50 lines of Python(github.com ↗)

3 points · by ColonelPhantom · 2y ago · discuss

comment 2y ago · link · parent

I disagree that the 'arcane sigil invocations' are necessarily a problem. Yes, they can be, but I also think they can definitely be preferable!

Naming everything as a function often leads to a problem of very deep visual nesting. For example, map-then-filter can be written as "filter p . map f" in Haskell, whereas in sigil-free languages you'd write a mess like (lambda (x) (filter p (map f x))) in Lisp or "lambda x: filter(p, map(f, x))" in Python.

Of course, function composition is a very simple case, but something like lenses are another less simple case where a library would be unusable without custom operators.

comment 2y ago · link · parent

OneAPI is an implementation of SYCL. Apart from being standardized by Khronos, SYCL and OpenCL don't have that much in common, except that they are often interoperable due to many SYCL implementations running on top of OpenCL. Intel specifically has two backends, one for OpenCL and one for the lower-level Level Zero API.

Saying OneAPI/SYCL is bad "because OpenCL" is the same as saying OpenCL is good "because CUDA" (since the NVIDIA implementation of OpenCL is called CUDA and uses the larger CUDA stack).

As for the FPGA/GPU code sharing, iirc FPGA vendors including Altera/Intel and Xilinx/AMD support OpenCL as well. The idea doesn't sound that crazy to me: GPU code also often uses small data types (fp16, tf32, int4), and both work with data parallelism. GPUs operate in parallel with SIMD vectors, but a compute accelerator FPGA achieves a similar thing by essentially pipelining the program. Effective pipelining requires parallelism too, since a serial FPGA program only has one stage active, similar to how a serial GPU program only has one ALU per compute unit active. As such both are mostly suitable for massively parallel programs.

comment 2y ago · link · parent

Hm yeah, I'm not sure what astrange's point was, other than probably dissatisfaction with the combination of exceptions and Either (which I think is awfully named, as it implies a certain 'equality' between l and r).

I haven't used Bluefin, but don't Bluefin exceptions suffer from the same issue where it, essentially, 'infects' the program flow? For example, `fst (5, error "second")` seems like it would translate to `fst $ (5,) <$> throw e "second"`, where you would also need to pull an `e` from somewhere. More realistic, something like head would probably be quite awkward:

head e [] = throw e "head: empty list" head e (x:xs) = pure x

You now need to pass in the exception handle, and the return value is now `Eff es a` instead of `a`. This means that you cannot just use the result, so you will likely need to fill your program with monadic stuff like do-notation, <$> and <$>, complicating the program flow and likely also reducing laziness.

comment 2y ago · link · parent

By simulating exceptions, do you mean a `Result t e` type (which Haskell calls `Either l r`)? You can use these and the Functor/Applicative/Monad hierarchy to handle errors.

What is presumably talked about is that Haskell also has actual exceptions, generated by calling e.g. `error` or `undefined`.

The semantics of these are.. interesting, mostly thanks to lazy evaluation. For example, `fst (5, error "second") ` is safe to evaluate because the second half of the tuple is a thunk and does not get evaluated. Additionally, there is, to my knowledge, no way to handle exceptions in pure code, presumably due to the undefined evaluation order.

That said, I'm not sure what the alternative would be, because a function like !! (list indexing) can fail and dealing with its fallibility would be a big burden on the programmer.

comment 2y ago · link · parent

GPUs are actually SMT'd to the extreme. For example, Intel's Xe-HPG has 8-wide SMT. Other vendors have even bigger SMT: RDNA2 can have up to 16 threads in flight per core.

comment 2y ago · link · parent

It's worth noting that compilation is a partially serial task (e.g. linking is often largely single-core). It's entirely possible that going from 4 to 8 threads is much more helpful than 12 to 24 threads, as a 24-thread system will have far more idle threads in comparison. (Of course this is assuming 4c8t Skylake, so a normal consumer i7. Skylake-X had more cores.)

comment 2y ago · link · parent

Correct. However, Zen 5 seems to be the first major 'scaling up' that AMD has done since the original Zen, given that the core seems to be moving from dispatching 6 to 8 instructions per clock and 4 to 6 ALUs. I would expect that SMT to be excellent for low-IPC workloads to get the most out of that scaling.

comment 2y ago · link · parent

You don't need X to run OpenCL, only a driver. Pretty sure the same holds for OpenGL.

comment 2y ago · link · parent

SYCL also doesn't meet the listed requirement of 'Intel and AMD teaming up'. Intel seems to be the only hardware vendor to actually care about SYCL, and AMD is instead backing HIP which is 'standardized' but boils down to 'just take cuda and run :s/cu/hip/g'.

If AMD were to work on SYCL tooling and, say, build a 'syclcc' next to 'hipcc' that ingested SYCL to run it on ROCm, I feel like interest in SYCL could potentially grow, since Intel is supporting it properly already and it would be actually a cross-vendor standard.

Codeplay (which is part of Intel) does provide 'plugins' to run oneAPI (SYCL) on NVIDIA and AMD hardware, which is great but is still being made, indirectly, by Intel, who in the end want to sell Intel hardware.

comment 2y ago · link · parent

OK, but isn't the memory management stuff part of the API? :)

And with HIP, the user-facing memory model is virtually identical to CUDA to my knowledge. Converting a CUDA program to HIP, assuming no unsupported features or platform details are used, is basically just "do s/cu/hip/g".

Also, HIP wasn't around in 2014. To program an AMD GPU back then, you were probably using OpenCL, which is nicely platform independent but also arguably somewhat archaic.

comment 2y ago · link · parent

What makes you think that CUDA's value prop is memory management? I have seen no indication that implementing the memory allocation system is the hard part of any GPGPU system, and HIP is mostly source-compatible with CUDA, so it's not like the user has to do anything different memory management-wise to run on AMD.

comment 2y ago · link · parent

The side ribbon of VSCode is called the Activity Bar. You can put it on top of the sidebar (making it more like a tab bar) or disable it entirely (which makes it a lot harder to open the sidebar or change the page it's on).

It's as simple as right click it -> Activity Bar Position -> ...

comment 2y ago · link · parent

Did you talk to anyone from Intel? It seems they were also present: https://community.intel.com/t5/Blogs/Tech-Innovation/Artific...

comment 2y ago · link · parent

Man, I was actually kind of happy about Mozilla's seemingly-measured response to the AI hype, and mostly running local models to perform actually useful tasks (translation, alt text generation).

But I really don't think cramming a bunch of proprietary online services like ChatGPT counts as "intentional and methodical". It comes across more like a "we need AI!!!" cry of desperation, throwing principles like privacy in the wind.

comment 2y ago · link · parent

My laptop (a Dell Latitude 5490, i5-8350u) with the screen backlight off and at idle goes down to 2.5w power consumption according to the battery statistics. An SSD idling at 1.9w would nearly double it!

comment 2y ago · link · parent

Then why is the fanless model, the Air, the cheapest laptop Apple is selling?

comment 2y ago · link · parent

I'm not entirely sure about the backend, but for the frontend Intel has come up with a 'split decoder'. Essentially, Skymont will have 3x 3-wide decoders working in parallel on different parts of the instruction stream. I have no idea how they find points to perform load-balancing between these clusters (outside of taken branches), but the 2x3-wide setup in Gracemont seems to work like a charm after some improvements over Tremont which debuted the split decoder scheme.

> This scheme appeared with Tremont, where it could only switch decoders at taken branch boundarie and Gracemont improves load balancing between the two decode clusters by automatically switching, instead of relying on taken branches. That helps performance in very long unrolled loops, which could get stuck on one decode cluster on Tremont. When we tested with longer loop lengths, we didn’t see any drop off in Gracemont’s instruction throughput:

- https://chipsandcheese.com/2021/12/21/gracemont-revenge-of-t...

comment 2y ago · link · parent

> Roads are physical easy to understand

???

Yes, roads require less 'active upkeep', an austerity government might stop funding transit but they will not close roads. However, this is more of a feature of the supposed 'independence' of car transport, not 'easy to understand'.

In addition, defunding transit would be a lot harder and weirder if it is in a form that requires actual infrastructure (metro, train, tram) rather than some stops and a schedule (bus). That's one potential reason to trust bus transit projects less.

Do keep in mind that roads aren't free after construction either; they typically require pretty significant upkeep (especially things like repaving, but also e.g. traffic signals).

comment 2y ago · link · parent

> Nothing is as expensive as your time.

Then public transport should be way cheaper than driving, as on transit you have some downtime where you can scroll through your phone, listen to some music, or perhaps even crack open your laptop if you're on a proper train. Driving requires constant attention, so you can't relax or do anything else in the meantime.

comment 2y ago · link · parent

Just because public transport is a poverty tax where you went to school does not mean buses and especially other transit are inherently for poor people. Buses do tend to be mediocre for longer distances, but the main issue is general quality of service.

I grew up in a region with fairly mediocre transit, but because the living environment is not hostile most things can easily be done by bike unless you need to go to another city. Hell, I biked 8km to school, and while somewhat time consuming it was quite literally free exercise.

When I went to uni, before moving to that city I relied on transit. Because of the low density in the region, trains are only half-hourly (which is by far the most sucky part) and it's on single-track rails so every train stops at all stations. However during rush hour it's still time-competitive with cars, and transfers are generally pretty good because those are the reason transit works in that region at all.

Something like "you need a car to be able to get to (store)" that's mentioned in another comment would be literally unthinkable here. You can get practically anywhere with a bike and a transit card.

comment 2y ago · link · parent

It is very easy to scale them as demand increases. There is a train to the next city over where I live in the Netherlands (both around 150k) around 10x per hour on weekdays. And that's on a single, dual track with a mix of 3 direct (intercity) trains and 2 slow trains that have 3 stops inbetween.

The intercity trains, when in a maximum length 6+6 car configuration of 2-floor trains, can carry over 1200 (sitting!) passengers. That's as much as a single lane of road can carry in half an hour with average car occupancy (low). So running such a train every 15 minutes should give a similar capacity to a free-flowing road with 2 lanes, while needing less room for infrastructure. Plus people mostly go to the station by foot, bike or bus rather than car, which is also nice capacity-wise and pollution-wise.

comment 2y ago · link · parent

When using Python, the REPL does not feel remotely integral to the experience. For example, my Django project, when an exception occurs in debug mode, has a nice page with a backtrace et cetera. However, I cannot resume, or poke around using a REPL, or even view details of local variables. I feel like if Django was implemented in Common Lisp this would not be a problem at all, if not for technical reasons then for cultural reasons.

comment 2y ago · link · parent

No, it's in Europe and you're not "expected" to go over the limit at all.

If you want to step on it, leave the city. Most non-access roads in non-built-up areas are 50mph, and more for motorways. Some major urban thoroughfares are also 45mph.

12345
13