This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/core/runtime/rank_barrier.h
T
Deadcode 1e968f6e1d radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves
  every shipped container
- Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime
- /v1/messages works with Claude Code as it ships (gearwave00001)
- a long agent conversation keeps its cached history when the client rewrites its last turn
  (manueloverride)
- a stream's first event goes out with the first token, so llama-benchy measures prefill right
- opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42)
- four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b)
- NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA
  adapters (baKon)
- many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool
  arguments and the CPU's vision and audio encoders
- plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
2026-10-16 18:25:18 +02:00

45 lines
1.6 KiB
C++

/* rank_barrier.h -- the release point for the tensor-parallel rank threads.
*
* Radiance is one process with one thread per rank, each owning one device (spec §1), so the step
* batch is shared by pointer rather than serialised to other processes. The barrier only
* establishes happens-before between the scheduler's release and each rank's first rad_issue, and
* between the ranks' last issue and the scheduler's next batch build. A condvar round trip costs
* ~1-2 us; an IPC broadcast of the batch costs tens of microseconds per step.
*
* Generation-based (sense reversal), so a fast rank re-entering for the next step cannot slip
* through a barrier its slower peers have not left yet.
*/
#pragma once
#include "../rad_core.h"
#include <condition_variable>
#include <mutex>
namespace rad {
class RankBarrier {
public:
explicit RankBarrier(int n_ranks) : n_(n_ranks < 1 ? 1 : n_ranks), waiting_(0), gen_(0) {}
RankBarrier(const RankBarrier&) = delete;
RankBarrier& operator=(const RankBarrier&) = delete;
void arrive_and_wait();
/* Release everyone regardless of how many have arrived, and make every later arrival return
* at once. Called on shutdown and on a device fault, so ranks are not left parked on a barrier
* an exited rank can no longer complete; the engine must be able to exit (spec §17). */
void abort();
private:
std::mutex m_;
std::condition_variable cv_;
int n_;
int waiting_;
uint64_t gen_;
bool aborted_ = false;
};
} /* namespace rad */