HNHacker News
TopNewBestAskShowJobs

cztomsik

601 karma · joined May 29, 2017

https://github.com/cztomsik
submissionscomments
cztomsik··on Show HN: Tokamak – Server-side framework for Zig
same thing, done in a different way. the only notable difference (except of writing less code) is that zig does not type-check the code which you don't use, so the genericity goes a bit further than what you can do in rust.
cztomsik··on Show HN: Tokamak – Server-side framework for Zig
Oh, I didn't know std.http.Server is not supposed to be used. I guess I could just use your project (as dependency) and that would fix that perf issue? And do a thread-pool and keep-alive, of course.

TBH perf was not my priority yet, I only wanted predictable memory usage and Zig was perfect choice for that (when compared to node.js).

cztomsik··on Show HN: Tokamak – Server-side framework for Zig
I think there are multiple reasons why Zig is great fit for this:

- zig has powerful meta-programming, it's a bit like functional programming with structs. I would consider that high-level concept, at least comparable to traits and constraints

- zig has anytype duck-typing. in any function, you can say that some arg is anytype, and then you can pass anything to it. type-checking still works, because it's done when you actually instantiate the function with known type. this is great for flat and simple API surface.

- server-side code usually have short life-time (request), so you can just use arena for all allocations, and free everything when you finish, this is super-simple to do in zig, because every api accepts allocator if it needs to allocate. rust arenas have lifetimes, which makes them problematic to use/embed deep down in the hiearchy. zig is not aiming for 100% safety so this is easy.

cztomsik··on Show HN: Tokamak – Server-side framework for Zig
thanks :) yeah, ava is my pet project, but there was very little activity lately because I was tight on deadline with another project. I hope to get back to it around next week.
cztomsik··on Ava-SQLite: Zig wrapper for SQLite with automatic migrations
FYI The migration script is not my idea, it's based on this wonderful article https://david.rothlis.net/declarative-schema-migration-for-s...
cztomsik··on Implementation of Mamba in one file of PyTorch
AFAIK mamba is continuation of the SSM research, which is basically something called long-convolution.

Instead of doing quadratic attention (computing how much each token attends to every other token) you just "somehow" compute a long (same length as input) convolution kernel, and then you apply the conv1d.

Again, from my limited understanding, it's bit related to applying FFT, doing some matmul and then IFFT back. We know that this works but it's slow. But there are many ways to compute FFT and one of them is with something called butterfly matrices. I think it's just approximation but it's good enough and it's very fast/efficient on current hardware.

To put this in context, quadratic sounds bad, but in practice, subquadratic algos are often slower because of hw limitations. So while there was a lot of excitement about SSM it's not so easy to say that llama is over now. Also, we don't know if mamba will scale up, and the only way to know that is to actually pay few millions for training. But I am optimistic.

Another interesting model from subquadratic family is RWKV. Worth checking, but I think you had a podcast about it :)

BTW: I am self-thought and I've only skimmed the paper some time ago so I might be very wrong.

BTW2: Another thing with attention is that there's usually KV-cache, which helps a lot with performance, and I think you cannot do that with mamba.

cztomsik··on Implementation of Mamba in one file of PyTorch
I only heard good things about fortran :)
cztomsik··on Ava PLS: open-source application for running language models locally
It's small, all-in-one binary. You only need to download model, and you can use builtin downloader to do that.
cztomsik··on Ava PLS: open-source application for running language models locally
How long did you wait, depending on the model size, it can take a while. Can you check logs? It's in the Settings -> System tab.
cztomsik··on Ava PLS: open-source application for running language models locally
LM Studio is great :) Also Faraday is great. But neither of them is open-source and this is going in a little different direction too (QuickTools, Workflows, there will be RAG and Vision support)
cztomsik··on Ava PLS: open-source application for running language models locally
everything what llama.cpp supports
cztomsik··on Ava PLS: open-source application for running language models locally
Yes, it's at localhost:3002/api/ (and api/*.zig files respectively)

The Workflows screen is feature-flagged for now and only visible in the DEV build.

Yes, that's the whole idea behind QuickTools - to make repetitive tasks available quickly. It's also supposed to be in the main menu (drag-drop, reorderable, etc.) but I didn't have time to work on that yet.

cztomsik··on Gooey: Turn almost any Python command line program into a full GUI application
This reminds me naked objects. The idea was that you only define Java classes with some annotations + theme and the whole GUI (or web frontend) application will be generated for you.

Very cool idea but it never worked out (to my knowledge).

cztomsik··on Ava PLS: open-source application for running language models locally
it's ok, you can put the link back I don't mind the competition :)

yes, I know it definitely works, so it has to be some stupid mistake but it's impossible to reproduce it without actual intel mac :-/

I had enough trouble with supporting monterey, which also does not work 100% AFAIK

cztomsik··on Ava PLS: open-source application for running language models locally
Intel works in Ava, it's just slow, for some reason.
cztomsik··on Ava PLS: open-source application for running language models locally
It goes a bit against the original idea, this should be 100% air-gapped. No phoning home, no data-collection, everything is private.
cztomsik··on Ava PLS: open-source application for running language models locally
It should work fine if you're on Apple silicon, everything else is unfortunately second-class citizen, because I don't have any other devices and it's currently just me working on it. But if you'd like to maintain the windows, linux or intel-based mac releases, ping me on discord and I'd be happy to discuss and to accept PRs.
cztomsik··on Ava PLS: open-source application for running language models locally
Actually, it was, here's the initial thread: https://news.ycombinator.com/item?id=37561085

The big news here is that it's now open-source: https://github.com/cztomsik/ava

cztomsik··on JSONB has landed
Yes, I know, the point was not to say that it's safe to depend on this universally, but rather why it's safe in JS and why it's not elsewhere -> other languages use hash maps simply because authors were either lazy or unaware of the original behaviour. (which sucks, in my opinion, but nobody can fix it now)
cztomsik··on JSONB has landed
I don't know what SQLite does, but in JS the order is actually defined. JS is not Java, object is not HashMap, if anything, it's closer to LinkedHashMap, but even that is not correct because there are numeric slots which always go first. https://tc39.es/ecma262/#sec-ordinaryownpropertykeys
cztomsik··on Accelerating Generative AI with PyTorch II: GPT, Fast
BS=1 also means you can only decode one token. This is not always what you want, and then you're back to matrix-matrix multiply again. Most of the from-scratch llama implementations start with matrix-vector because it's simpler & easier. But eventually, you will want to serve multiple users, or compute multiple beams together...
cztomsik··on LM Studio – Discover, download, and run local LLMs
Also, if you don't know what all the toggles are for, this is a simpler attempt by me: https://www.avapls.com/
cztomsik··on Apple unveils M3, M3 Pro, and M3 Max
Why exactly is tile-based a bad idea? Most rendering engines are tile-aware already.
cztomsik··on Was Rust Worth It?
Functions in Zig can be called both in runtime and in compile-time. You can force some expression to be called during comptime using a keyword, and sometimes the comptime is implied (like when you define top-level const)

If a function is called in comptime, it can also return types. So for example:

    // this is a function which accepts a type
    // if you accept type, you also have to restrict the arg to be comptime
    // if the arg is comptime it still does not mean that the function cannot be called in runtime,
    // but in this case, it returns type, so it is comptime-only function
    // there are also cases where this is not true, like std.mem.eql(u8, a, b) which accepts type,
    // but can be called in runtime because it does not return type
    fn Wrapper(comptime T: type) type {
        return struct { value: T };
    }

    const F32Wrapper = Wrapper(f32);

    // @TypeOf(x.value) == f32
    var x: F32Wrapper = .{ value: 1.0 }
cztomsik··on Was Rust Worth It?
No. Rust forces you to spend endless hours doing mental gymnastics which shouldn't be needed in the first place (linked data-structures, owned arenas, or even just boxed slices are impossible in safe rust).

And you just keep refactoring/improving/desperately trying different ideas, because it never feels right.

It's ok if you don't agree but pls don't try to make my responses look like I like Rust, I don't and I'd happily get those years back if it was possible.

cztomsik··on Jina AI launches open-source 8k text embedding
Small context window means you cannot embed the whole document, you are embedding just a part.

So, if there is some information at the bottom which is dependent on something which is at the top, your embedding could be entirely wrong.

cztomsik··on Was Rust Worth It?
No, usually you don't. Rust has closures, iterators, generics, different traits for operator overloading, smart pointers, etc.

Zig doesn't have any of that. It's very interesting combination of low-level, predictable code, with meta-programming, where you get some of that abstraction back.

i.e. Zig does not have generics, but your function can return type, so generic list is just a function which returns a newly created struct.

cztomsik··on Was Rust Worth It?
This. I have exactly the same experience, I can't believe how much I was able to ship with Zig and the code mostly feels like "done".

You can always improve it, but there's no need to. With Rust, I was never happy, even after 5 years, I was still thinking about better abstractions and implementing more traits, making it more generic, etc.

cztomsik··on Control Center on macOS is always re-rendering its SwiftUI causing 1% CPU load
So? 410M is reported, it does not mean it's actually used.

I'm not sure if you are familiar with how virtual memory works but if you are, then I don't understand what's your point.

cztomsik··on macOS Sonoma is available today
I have similar feelings. Apple did a wonderful job with M1/M2, but on the software side, I have mixed feelings. Xcode is a mess, and Swift UI is not a complete replacement for Cocoa.

And on the OS side, I feel like Apple is creating features that I instantly disable because they do the exact opposite of what I want.

← PreviousPage 3 of 11Next →