Better HN
topnewbestaskshowjobs
Log inSign up

ColonelPhantom

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

Submissions

comment 3y ago · link · parent

You can run the SSR server in the same process, and the main benefit is that the client is a lot thinner (only needs to swap in HTML, no need to render anything).

Depending on the server framework, it should be perfectly possible to e.g. have uniform routes for JSON data and HTML hypermedia, although you do need to be careful with churn in such cases; you don't want a website redesign to break your native app. The HTMX author has an essay describing a solution: https://htmx.org/essays/splitting-your-apis/. Essentially, just implement two APIs! Since you can do this in a single backend (e.g. Django project) the amount of duplicate code should remain fairly limited anyway.

Also, many modern SPAs are highly complex in order to do things that don't require any work in a hypermedia application. For example, if you want JS-disabled clients to be able to view your page, you need to run a copy of the client on the server, necessitating a full JS runtime there (bad if you're not using server-side JS already!). And then you also need complex hydration logic so that it gracefully transitions to a full SPA. Plus this solution sucks if you want to use something other than JS on the backend.

With hypermedia tools like HTMX it is generally way easier to achieve progressive enhancement (although it will still require some thought, see e.g. https://htmx.org/docs/#progressive_enhancement)

comment 3y ago · link · parent

GIMP does have search, just hit / and you can find any action.

The problem with search and discoverability is that search requires input from me, whereas discoverability means that the program explicitly offers its features to me. With search, I would never discover some handy new feature I wouldn't think of myself, or something that is named differently than I expect.

Hunting through a menu, while not optimal, allows me to view a 'catalog' of all the features.

comment 3y ago · link · parent

OBS works fine via xdg-desktop-portal. I think Firefox (which you can use for Meet and Zoom?) also works, but it's been ages since I tried. Not sure about Chrome and Electron apps, but for those you'll at least need a pretty new version (which Discord for example refuses to ship iirc).

comment 3y ago · link · parent

KDE doesn't have this problem, actually. At least it's not uglier than X11, since by default (since 5.27 or so) it uses X11's DPI scaling for Xwayland apps by default. You can change that under Display settings if it doesn't work for your apps and you need to revert to ugly blurry upscaling like GNOME and sway do.

comment 3y ago · link · parent

FTFY: GNOME Shell/Mutter and wlroots don't fractionally scale chrome, discord, vscode, spotify, beeper and other Xwayland applications.

KDE Plasma Wayland by default applies Xwayland fractional scaling for X11 apps, which while less good than Wayland-native scaling mostly works. (If it's broken for you/an app you use, you can toggle it to let the DE scale up from 100%.)

comment 3y ago · link · parent

KDE is actually hard at work to fix these problems and make sure programs have e.g. better defaults, are more consistent, and easier for new users (see for example the KHamburgerMenu widget, which even gives users a choice if they prefer an old fashioned menu). The core principle of the KDE HIG is "simple by default, powerful when needed": https://develop.kde.org/hig/

The difference is that KDE prefers doing this incrementally, which takes longer especially outside of core apps like Konsole and Dolphin, but it also prevents clusterfucks like the gnome-terminal vs gnome-console situation, and reduces churn in general.

comment 3y ago · link · parent

Maybe it depends on what you're dragging to? Dragging from Ark to Dolphin works fine on my Wayland machines.

comment 3y ago · link · parent

You'd also need to load the source code from disk. At the point where you're doing that, the 512-byte limit isn't really relevant anymore, and adding "loading code from disk" within the 512 bytes isn't exactly realistic.

comment 3y ago · link · parent

Does VoltaML have any support for AMD/Intel GPUs or CPU inference? e.g. I think Intel's openVINO supports ONNX, but the Github page only mentions Nvidia and CUDA.

comment 3y ago · link · parent

Yes, Windows doesn't have overcommit. (Also not with swap, since overcommit is unbacked virtual memory, which Windows still doesn't allow. The only thing it allows is disk-backed virtual memory).

But as a user, I don't care (except that I don't have to worry about an OOM killer because an allocation will just fail). The only real difference is that application developers need to be careful with allocating memory without using it, unlike on Unix-likes.

Because software on Linux runs on the assumption of overcommit, you shouldn't disable it, even though the lack of overcommit on Windows is not problematic.

comment 3y ago · link · parent

Overcommit != Swap.

Overcommit is allocating virtual memory without any backing. Swap is allocating physical memory backed by disk.

Overcommit is useful in some cases, for example to preallocate a large heap without immediately making it all resident. Or to allocate 'guard' pages to fight buffer overflows. On Linux, overcommit is commonly assumed and as such disabling it tends to break some programs, as it's not out of the ordinary for something to allocate 100s of GBs of virtual memory.

comment 3y ago · link · parent

Using vladmandic sd.next with v1-5 works fine* on my RX 580 4GB at around 1s/it on ROCm and 1.5s/it on DirectML.

fine = requires --medvram or --lowvram in order to not run out of memory. The speeds above are with medvram, which is just about on the edge of what's possible. These options compromise speed but are still better than running on the CPU generally.

comment 3y ago · link · parent

Why would I write my own JS when "hx-get" does the job? Writing your own JS makes sense in some cases, but using HTML partials is also useful in many cases where you need to talk to the server anyways (since they e.g. prevent logic duplication). HTMX just makes it easy to work with them, as they're a single attribute away, rather than doing the request and insertion by hand.

Native clients are deliberately out of scope, but scraping HTML isn't the suggested solution. Rather, it is having a JSON API next to the hypermedia API: https://htmx.org/essays/splitting-your-apis/. This does have the downside of duplicate work, but does bring stability to the API without introducing something like GraphQL.

And yes, you will need to learn HTMX to use HTMX. But the surface of HTMX is generally quite small, and composes well with knowledge about HTML/CSS.

comment 3y ago · link · parent

https://htmx.org/examples/update-other-content/

If you need to modify the card and something else, probably using hx-swap-oob is the best approach to update the cart icon.

comment 3y ago · link · parent

Having a common idiom for common operations like error propagation is not "absurd and eyebrow-raising".

What sounds absurd to me is obscuring the actually interesting control flow significantly in favor of either showing the trivial control flow or alleviating the need to learn the one (1) single operator that represents said trivial control flow.

comment 3y ago · link · parent

Aside from the other reply which points out that common idioms have useful shorthands like ?, Rust's type system is also error-aware. Rust errors are actual sum types (either Ok(T) or Err(E)), while Go just uses multiple return/tuples to return (value, nil) or (nil, error). This means that in Rust, you are forced to handle errors (well, unless you don't care about the return value, but then the compiler still gives a warning). This means it is harder to make a mistake with error checking.

comment 3y ago · link · parent

A lot of modern games that do not support Intel XeSS do still support AMD FSR, which looks worse than XeSS but works fine on all three GPU vendors. FSR2 especially looks 'decent enough', FSR1 does look a lot worse.

comment 3y ago · link · parent

Very nice! I recall reading that the HVM has some semantic differences with the classic lambda-calculus, which resulted in different results for some programs. Would this be an issue when e.g. translating Haskell programs? (and/or is there some way to 'emulate' lambda calculus semantics?)

Also, are there any plans to get this working on non-Nvidia GPUs, e.g. with ROCm/HIP (which would hopefully be a straightforward translation, if AMD's software does its job) or OpenCL (more effort, but more portable)?

comment 3y ago · link · parent

One thing about LLMs is that from what I know, batching is very effective with them, because to generate a token you need to basically go through the entire network for just that one sample. If you batch, you still need to stream the entire network, but that doesn't get any more expensive; you use each piece of data more often on hardware that used to just sit idle.

So I assume that at an OpenAI-scale, they're more than able to batch up requests to their models, which gives a tiny latency increase (assuming they're getting many requests per second), but massively improves compute utilization.

comment 3y ago · link · parent

If you look the other way around (which is more relevant anyways), you can compile Mesa for Windows. However I'm pretty sure only the software renderer is available because Mesa is not capable of interfacing with the Windows kernel driver, as all the other drivers are coupled with Linux driver interfaces, iirc. (At least I'm quite certain this is the case for AMD.)

I'm also quite certain the proprietary NVIDIA driver shares a ton of code between Windows and Linux.

comment 3y ago · link · parent

The Tinybox is planned to use AMD, not NVIDIA. The GPU they're using to build Tinybox is the 7900 XTX.

comment 3y ago · link · parent

I think in the case of LLM inference the main bottleneck is streaming the weights from VRAM to CU/SM/EU (whatever naming your GPU vendor of choice uses).

If you're doing inference on multiple prompts at the same time by doing batching, you don't take more time in streaming. But each streamed weights gets used for, say, 32 calculations instead of 1, making better use of the GPU's compute resources.

comment 3y ago · link · parent

Or Intel! They're not making any high-end cards currently, but the A770 16GB is pretty decent if you're on a budget. The software support isn't really amazing yet, but their GPUs have some quite decent matmul acceleration.

Unfortunately support for their GPUs is not upstream in Tensorflow or Pytorch, and I don't think they're well-supported by Llama.cpp either, but Intel does look quite promising. I also believe that Intel oneMKL works on Arc GPUs these days, which in CPU land is amongst the fastest BLAS libraries out there. Also their matrix hardware is accessible using OpenCL extensions, which means that rolling a custom kernel for things related to quantization should be quite possible.

(For Tensorflow and PyTorch, you need to install a custom package called Intel Extension for $FRAMEWORK. The PyTorch one got updated to PyTorch 2.0 recently, which is promising.)

Currently rumors seem to indicate that their second generation GPUs will go from 32 to 64 Xe cores for the top model, and keep the 256 bit bus. If Intel were to double the VRAM to 32 GB as well (at least as an option, just like the A770 comes in both 8GB and 16GB variants), it'd immediately make them the crown of consumer VRAM size, which I'd wager would drive a lot of interest from the ML community.

comment 3y ago · link · parent

CPUs and GPUs both interface with their own memory, and those memories have a certain bandwidth. Generally, CPU memory has relatively little bandwidth, but relatively good latency. (For example, an i9-13900K supports memory up to around 100 GB/s, while even my previous GPU, a midrange Radeon HD 7850 from 2012, has over 150 GB/s of bandwidth).

An integrated GPU shares memory with the CPU, so at best it gets the same amount of bandwidth assuming the CPU is not using any (which is rather unlikely).

A dedicated GPU has its own private high-bandwidth memory (an RTX 4090 has a memory bandwidth of over 1000 GB/s), but to get anything in there it needs to be loaded over the PCIe bus (which has a measly 32 GB/s bandwidth for PCIe 4.0 x16).

That said, CPU memory does have one big advantage: it tends to be much larger. You can pair up to 192 GB with a regular Ryzen 7000 CPU, while consumer GPUs don't go above 24 GB of memory (RTX 4090, RX 7900 XTX). (There are bigger GPUs out there, but those are generally intended for datacenters, and if you go that route, an Epyc or Xeon CPU can also support much more memory than a plain desktop Ryzen, although you can also slot multiple GPUs into a single server.)

I believe that for LLM performance, memory bandwidth is key, because all the neural network layers need to be streamed from memory, and very little work is done with it each time, although I guess batching operations could help if you're working at scale, since each weight would be applied multiple times then.

comment 3y ago · link · parent

When did you try PyTorch and Tensorflow? I think they were updated pretty recently to the latest upstream releases, which is necessary to work with Python 3.11 which is the version that Arch is currently shipping.

comment 3y ago · link · parent

Intel already has a working GPGPU stack, using oneAPI/SYCL.

They also have arguably pretty good OpenCL support, as well as downstream support for PyTorch and Tensorflow using their custom extensions https://github.com/intel/intel-extension-for-tensorflow and https://github.com/intel/intel-extension-for-pytorch which are actively developed and just recently brought up-to-date with upstream releases.

comment 3y ago · link · parent

The A770 is available in a 16 GB variant, making it the cheapest card on the market to have that much VRAM. Nvidia's closest competitor, the 3060, only has 12 GB and to find more you need to go up to a 3090/4080. On the AMD side the 6800 also has 16 GB, but it's a fair bit more expensive than an A770.

comment 3y ago · link · parent

Once upon a time that may have been a very hard to dispute thing, but I'm not so sure anymore.

For starters, recent Firefox versions do proper process isolation per domain, similar to Chrome, which has long been claimed to be the primary security benefit of Chrome-based browsers.

In addition, the Firefox codebase is partially rewritten in Rust. This effort is incomplete and likely always will be, but it's still significant. Keep in mind that according to Google, 70% of security vulnerabilities in Chrome are related to memory unsafety!

comment 3y ago · link · parent

What do you mean by polyglot? As in multiple hardware, or mixed-source? HIP is mostly API-compatible with CUDA, so you can just mix host code and device code with it.

That said, ROCm does indeed work with machine code instead of IR. You can compile fat binaries with more than one type of machine code and they'll work on any of the chips you compiled for, at the cost of the binaries becoming, well, basically obese if you want a decent range of hardware supported.

comment 3y ago · link · parent

In that case, can't you just restart the REPL? Or give the program a main function that you run?
1
678
13