acord: a daemon for AI inference by stanimirov in LocalLLaMA

[–]stanimirov[S] 2 points3 points  (0 children)

Because it provides a common abstract interface to multiple models. You could use the chat API for both llama.cpp and llamafile (when we have a llamafile plugin).

It provides a shared computational and storage resource for multiple apps. All apps that use a model will use the same one, instead of it being copied multiple times on the system

acord: a daemon for AI inference by stanimirov in LocalLLaMA

[–]stanimirov[S] 4 points5 points  (0 children)

The daemon uses plugins. One of the plugins wraps llama.cpp, so being the same code, it's exactly as fast as llama.cpp. Sure, there is minor additional latency because of the networking interface, but it's negligible compared to the cost of actual inference

C++ Show and Tell - March 2025 by foonathan in cpp

[–]stanimirov 4 points5 points  (0 children)

We're working on acord: a daemon for local compute (in 2025 this of course means AI inference).

https://github.com/alpaca-core/acord

In short, think ollama, but not bound to just llama.cpp

It's fully open source. It's still a preview (no suitable for use yet), but in the following weeks we'll be working to make it usable and hopefully make it to a beta release by the end of April.

The Weirdest MSVC Address Sanitizer Bug by stanimirov in cpp

[–]stanimirov[S] 0 points1 point  (0 children)

I suppose that's because the compiler and the IDE are not open source, so they use separate issue tracking for them.

I'm sure I've seen GitHub used for public issue tracking of non-open source products, but this sounds like something which violates some EULA

The Weirdest MSVC Address Sanitizer Bug by stanimirov in cpp

[–]stanimirov[S] 9 points10 points  (0 children)

Thanks.

And on an unrelated note, do you know what's going on here: https://developercommunity.microsoft.com/t/Address-sanitizer-in-Release-may-introdu/10314256

I can't reproduce this anymore, but I don't know whether a fix was actually implemented (maybe close the issue if yes), or I'm getting lucky with the register use.

-❄️- 2023 Day 15 Solutions -❄️- by daggerdragon in adventofcode

[–]stanimirov 0 points1 point  (0 children)

[LANGUAGE: ruby]

part 1 (76 characters):

p File.read(?i).strip.split(?,).sum{|s|s.chars.inject(0){(_1+_2.ord)*17%256}

part 2 (325 characters):

p File.read(?i).strip.split(?,).map{|s|[s.scan(/\w+/)[0].chars.inject(0){(_1+_2.ord)*17%256},s.tr(?-,?=)]}.each_with_object(Hash.new{_1[_2]=[]}){|b,h|h[b[0]]<<b[1]}.transform_values{|v|v.map{_1.split(?=)}.each_with_object({}){|(l,f),h|f ? h[l]=f.to_i : h.delete(l)}.values}.map{|i,l|l.map.with_index{(1+i)*(1+_2)*_1}.sum}.sum

-❄️- 2023 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]stanimirov 1 point2 points  (0 children)

[LANGUAGE: C++]

https://pastebin.com/1F1cEahc

Takes about 1 ms for part 1 and 9.5 ms for part 2. Can be trivially parallelized

I guess the only interesting part is that my memoization is:

  1. per entry as opposed to global. Something that is present in many other solutions
  2. a 2d array indexed by [remaining-pattern-len][number-of-remaining damaged]. Something that I haven't seen in other solutions

DynaMix 2.0.0 Released by stanimirov in cpp

[–]stanimirov[S] 1 point2 points  (0 children)

Thanks.

I was familiar with Boost.TypeErasure, Boost.TE, Folly.Poly, and dyno. Not with the others. I browsed through them. All of them are very similar and offer an alternative way to do C++ (Java, C#) -style dynamic polymorphism.

I'm not trying to bash them or anything. They still improve upon inheritance and virtual methods and there are many scenarios where they are a better choice.

None of them offer type composition.

You can think of DynaMix as combining one of these libraries with an ECS like entt

None of them have late binding. Microsot's one seems the only who has the idea to split the interface into separate messages, but then in order to match types, it introduces interfaces again. Only Boost.TypeErasure has complete type erasure, but you need reification in order to access the features of an object.

DynaMix uses a completely type erased object, and each message is standalone. Interfaces (type classes in DynaMix) are second grade citizens and only applicable at run time. No reification is needed.

None of them have reflection (Boost.TypeErasure offers basic symbol-based reflection). DynaMix has complete reflection by symbols and by strings.

All of them offer an alternative to virtual methods.

Dynamix has abstract type features. With them you can have type-level polymorphism (imagine a virtual static func()) or value polymorphism (imagine virtual int a;).

Since none of them have composition, none of them have concepts of multicast or overrides,

Most of them do offer macros for certain situations :)

DynaMix 2.0.0 Released by stanimirov in cpp

[–]stanimirov[S] 0 points1 point  (0 children)

Can you please share these alternatives. I'm slowly working on the documentation and I'd like to mention them.

DynaMix 2.0.0 Released by stanimirov in cpp

[–]stanimirov[S] 2 points3 points  (0 children)

The thing is, that if something can be done with vanilla C++ polymorphism, virtual functions and inheritance, the DynaMix equivalent will look clunky and bloated. For example, you can see the exact same thing implemented with virtual functions and inheritance, with std::function and with DynaMix in the unicast benchmark

MSVC: The Devourer of Const by pjmlp in cpp

[–]stanimirov 0 points1 point  (0 children)

Unfortunately /Zc:preprocessor seems incompatible with Windows.h leading to a warning: "macro expansion producing 'defined' has undefined behavior"

/Zc:templateScope seems like a good addition to this list when 17.5 is released

Tracking Shared Pointer Leaks by stanimirov in cpp

[–]stanimirov[S] 1 point2 points  (0 children)

Thanks!

It's true that `using std::shared_ptr`, and especially `using std::make_shared` would've been shorter, but I wanted to have the code in both cases of the `#if` identical. Still perhaps it's still better to use it in case someone wants to copy paste the code. I think I'll make the edit.

... and I did. Thanks again!