Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Avarok-Cybersecurity/atlas
/ functions
Functions
7,049 in github.com/Avarok-Cybersecurity/atlas
⨍
Functions
7,049
◇
Types & classes
847
↓ 10 callers
Method
merge_equivalent_successors
Merge states with identical incoming or outgoing transition structure (`ab | ac | ad` -> `a(b|c|d)`, and the mirror case). Upstream renamed this `Mer
crates/xgrammar/src/fsm/simplify.rs:164
↓ 10 callers
Function
mla_q_rope_extract_batched
( gpu: &dyn GpuBackend, kernel: KernelHandle, q_full: DevicePtr, q_rope_out: DevicePtr, nu
crates/spark-model/src/layers/ops/prefill_attn_a.rs:19
↓ 10 callers
Function
mla_q_rope_writeback_batched
( gpu: &dyn GpuBackend, kernel: KernelHandle, q_rope_in: DevicePtr, q_full: DevicePtr, num
crates/spark-model/src/layers/ops/prefill_attn_a.rs:49
↓ 10 callers
Method
open
Open an existing layout (panics if a file is missing or undersized).
crates/spark-storage/src/layout.rs:52
↓ 10 callers
Method
peek_and_consume
Consume a token of `ty`, or report `message`.
crates/xgrammar/src/grammar/parser.rs:83
↓ 10 callers
Function
quantized_auto
Load a quantized weight using the appropriate naming convention. For `Fp8Dequanted`, requires `quant_ctx` (absmax_k, quantize_k, stream) to runtime-q
crates/spark-model/src/weight_map/nvfp4_detect.rs:190
↓ 10 callers
Method
record_event
(&self, event: u64, stream: u64)
crates/spark-runtime/src/metal_backend.rs:609
↓ 10 callers
Method
render
Render the complete grammar to EBNF text — one rule per line.
crates/xgrammar/src/grammar/printer.rs:29
↓ 10 callers
Method
rollback
Roll back the matcher by `n` accepted tokens / strings. Each prior `accept_token`/`accept_string` is one unit; a stop token is a zero-byte unit whose
crates/xgrammar/src/matcher/matcher.rs:309
↓ 10 callers
Method
router_input
Apply the router pre-normalization (Gemma-4 only) and return the pointer that should be fed into the gate GEMV. If the MoE has no router_pre_norm weig
crates/spark-model/src/layers/moe/helpers_c.rs:115
↓ 10 callers
Method
rule_region
(&self, rule_id: i32)
crates/xgrammar/src/compiler/decompose.rs:210
↓ 10 callers
Method
st
(&mut self)
crates/xgrammar/src/grammar/functor/optimizer.rs:197
↓ 10 callers
Method
stream_wait_event
(&self, stream: u64, event: u64)
crates/spark-runtime/src/metal_backend.rs:635
↓ 10 callers
Method
to_dfa
Subset-construction NFA -> DFA. Returns `Err` if the result would exceed `max_num_states`.
crates/xgrammar/src/fsm/algorithms.rs:50
↓ 10 callers
Method
trim_proposer_state
( &self, _seq: &mut SequenceState, _num_accepted: usize, _stream: u64, )
crates/spark-model/src/engine/tests.rs:312
↓ 10 callers
Function
upload_bytes
───────────────────────── upload helpers ─────────────────────────
crates/spark-model/examples/moe_microtest.rs:101
↓ 10 callers
Method
visit_expr_id
Visit an expression by id.
crates/xgrammar/src/grammar/functor/mutator.rs:99
↓ 10 callers
Function
watchdog_params
Read the per-model watchdog tunables. Returns the historical-default `WatchdogParams` until `set_watchdog_params` runs — so unit tests and any pre-boo
crates/spark-server/src/scheduler/helpers.rs:369
↓ 9 callers
Method
_post
POST to /v1/chat/completions. Returns (http_status, parsed_body).
scripts/dev/coherence_test.py:44
↓ 9 callers
Method
add_rule_with_hint
Add a rule with a body, deriving a unique name from `name_hint`.
crates/xgrammar/src/grammar/builder_rules.rs:36
↓ 9 callers
Method
add_segment
Append `element` to the result, inserting a separating space when the result is non-empty — port of `AddEBNFSegment`.
crates/xgrammar/src/regex/converter.rs:45
↓ 9 callers
Method
advance
Advance a set of states — see [`Fsm::advance`].
crates/xgrammar/src/fsm/compact.rs:110
↓ 9 callers
Method
all_reduce
(&self, _ptr: u64, _bytes: usize)
crates/spark-comm/src/lib.rs:161
↓ 9 callers
Method
alloc_state
(&self, _gpu: &dyn GpuBackend)
crates/spark-model/src/layers/mtp_head.rs:248
↓ 9 callers
Function
args_for_idx
Reassembled arguments for `idx`: concatenated live fragments, else the buffered `ToolCallDelta`, else the complete `ToolCall`'s arguments.
crates/spark-server/src/tool_parser/tests/group_g_parallel.rs:41
↓ 9 callers
Method
at_end
`current_ == end_`: at or past the terminator.
crates/xgrammar/src/regex/cursor.rs:48
↓ 9 callers
Method
at_xml_layer
Whether XML-style emission applies at the current nesting depth (root or first level).
crates/xgrammar/src/schema/converter.rs:122
↓ 9 callers
Method
aux_index
Index into `edge_aux_data`, or `-1` if not a repeat reference.
crates/xgrammar/src/fsm/edge.rs:93
↓ 9 callers
Function
batched_embed
Batched embedding: gather N rows from embedding table in one launch. Replaces N individual D2D copies with a single kernel. `token_ids_dev` must poin
crates/spark-model/src/layers/ops/sampling.rs:73
↓ 9 callers
Function
bf16_to_f32
(x: u16)
crates/spark-runtime/src/cutlass/tests/mod.rs:30
↓ 9 callers
Method
cache_stride
Cache stride in elements (for FP8/BF16 kernels that need explicit stride). Same for all layers (element count is dtype-independent).
crates/spark-runtime/src/kv_cache/paged_impl.rs:358
↓ 9 callers
Function
compile_ebnf
Compile an EBNF grammar against [`tok`].
crates/xgrammar/src/matcher/tests.rs:62
↓ 9 callers
Function
ctx
()
crates/spark-runtime/src/cutlass.rs:220
↓ 9 callers
Function
cuEventSynchronize
crates/atlas-kernels/hip/libcuda_hip_shim.cpp:76
↓ 9 callers
Function
cuMemAlloc_v2
── memory ────────────────────────────────────────────────────────────
crates/atlas-kernels/hip/libcuda_hip_shim.cpp:28
↓ 9 callers
Method
decode_batched
( &self, hidden: DevicePtr, residual: DevicePtr, num_tokens: usize, st
crates/spark-model/src/layers/qwen3_ssm/mod.rs:232
↓ 9 callers
Function
dense_gemm_tc
Dense BF16 GEMM: C = A @ B^T. A: [M, K] row-major (activations) B: [N, K] row-major (weights, HuggingFace layout) C: [M, N] row-major (output) Kerne
crates/spark-model/src/layers/ops/gemm_dense.rs:26
↓ 9 callers
Function
dequant_nvfp4_to_bf16
Dequantize an NVFP4 weight to BF16 on CPU, then upload to GPU. Used at load time when projections are NVFP4-quantized on disk but need BF16 format fo
crates/spark-model/src/weight_map/fp8_lut.rs:21
↓ 9 callers
Function
ensure_blocks_through_decode
Phase 6.3 — Sliding-window allocation helper (decode path). Ensures `seq.physical_block_for(abs_block_idx)` is `Some` after this call returns. With H
crates/spark-model/src/model/block_mgmt.rs:196
↓ 9 callers
Method
ep_broadcast_tokens
Bulk broadcast: send an array of u32 tokens from rank 0 to all ranks. Uses a single NCCL broadcast instead of per-token broadcasts. Per-token broadca
crates/spark-model/src/model/impl_a2.rs:104
↓ 9 callers
Method
grammar
The associated optimized grammar.
crates/xgrammar/src/compiler/compiled_grammar.rs:194
↓ 9 callers
Function
h2d
(dev: u64, host: &[T])
crates/atlas-spark-bench/benches/moe_decode_vs_prefill.rs:33
↓ 9 callers
Method
hss_window_start
(&self)
crates/spark-model/src/traits.rs:179
↓ 9 callers
Function
id_of
Resolve a content token's id by its decoded bytes.
crates/xgrammar/src/matcher/tests.rs:74
↓ 9 callers
Function
load_expert_proj
Load one MoE expert projection, dispatching by the on-disk format so the V4 loader handles every DeepSeek-V4-Flash checkpoint variant. The nvidia chec
crates/spark-model/src/weight_loader/deepseek_v4/assemble.rs:31
↓ 9 callers
Function
load_hc_f32
Resolve the first existing tensor among `candidates`, returning an F32 device pointer (BF16 tensors are widened). Errors if none exist or the element
crates/spark-model/src/weight_loader/deepseek_v4/assemble.rs:483
↓ 9 callers
Function
load_qkvo_tp
Sequence the four Q/K/V/O loads via a loader-supplied closure. The closure receives `(name, full_out, full_in, kind)` and returns the loader's represe
crates/spark-model/src/tp_shard.rs:251
↓ 9 callers
Function
maybe_dump_gdn_buf
Snapshot `n_elements` BF16 values starting at `ptr + byte_offset` to `<ATLAS_GDN_DUMP>/gdnsub_step0_L{layer_idx}_{stage}.bin`. Skips when `ATLAS_GDN_D
crates/spark-model/src/layers/qwen3_ssm/debug.rs:60
↓ 9 callers
Function
mix
Mix several values into `seed` (incremental `HashCombine`).
crates/xgrammar/src/grammar/functor/hash_walk.rs:30
↓ 9 callers
Function
moe_batched_blend
Batched sigmoid blend: output += sigmoid(dot(normed, gate_weight)) * shared_out. Grid: (num_tokens, 1, 1) Block: (256, 1, 1)
crates/spark-model/src/layers/ops/moe_grouped_a2.rs:83
↓ 9 callers
Method
next_separator
The next contextual separator, advancing the `is_first` state. Port of `NextSeparator`.
crates/xgrammar/src/schema/indent.rs:115
↓ 9 callers
Method
next_state
First transition target, or [`NO_NEXT_STATE`].
crates/xgrammar/src/fsm/compact.rs:98
↓ 9 callers
Function
normalize_tool_call_arguments
F76 (2026-04-29): pre-parse `tool_calls[*].function.arguments` from OpenAI's wire format (JSON-encoded string) into the JSON value the model's chat te
crates/spark-server/src/tokenizer.rs:19
↓ 9 callers
Method
offset
(&self, key: GroupKey)
crates/spark-storage/src/layout.rs:84
↓ 9 callers
Method
owned_expr
Decode `expr_id` into an [`OwnedExpr`], pre-decoding tag dispatch.
crates/xgrammar/src/grammar/functor/mutator.rs:182
↓ 9 callers
Function
parse_ebnf
Parse a BNF/EBNF grammar string into a [`GrammarData`]. `root_rule_name` names the start rule (xgrammar's default is `"root"`). Returns a [`ParseErro
crates/xgrammar/src/grammar/parser.rs:216
↓ 9 callers
Function
per_token_group_quant_fp8
( gpu: &dyn GpuBackend, kernel: KernelHandle, input_bf16: DevicePtr, output_fp8: DevicePtr,
crates/spark-model/src/layers/ops/gemm_quant.rs:312
↓ 9 callers
Method
predequant_to_fp8
Pre-dequant NVFP4 → FP8 E4M3 for zero-overhead prefill GEMMs. Reads B_packed[N, K/2] + B_scale[N, K/GROUP_SIZE] + scale2 and produces B_fp8[N, K] on
crates/spark-model/src/weight_map/quantized.rs:152
↓ 9 callers
Function
rd
(p)
bench/longcode/hang-forensics/gdn_chain_diff_a3b.py:17
↓ 9 callers
Method
ref_rule_id
Referenced rule id, or `-1` if this is not a rule reference.
crates/xgrammar/src/fsm/edge.rs:84
↓ 9 callers
Method
release_slot
(&self, idx: usize)
crates/spark-model/src/model/ssm_pool.rs:176
↓ 9 callers
Method
sample
Sample a token from logits on the GPU. `logits_ptr` points to `[vocab_size]` BF16 values on device. Reads BF16, expands to FP32, then samples with fu
crates/spark-runtime/src/sampler.rs:168
↓ 9 callers
Method
save_snapshot
Register a snapshot slot as belonging to a session.
crates/spark-server/src/session_manager.rs:43
↓ 9 callers
Method
scale_embeddings
Scale in-place embeddings by config.embed_scale. The residual stream is always BF16, so this dispatches `embed_scale::bf16_scale_inplace`.
crates/spark-model/src/model/impl_a3.rs:42
↓ 9 callers
Method
segments
(&self)
crates/xgrammar/src/compiler/decompose.rs:129
↓ 9 callers
Method
skip_ws
(&mut self)
crates/xgrammar/src/schema/json_value.rs:107
↓ 9 callers
Method
ssm_gates
FP32 [gate, beta] for GDN (num_v_heads * 2 floats).
crates/spark-runtime/src/buffers.rs:261
↓ 9 callers
Function
test
(name, prompt, max_tokens=150, pattern=None, timeout_s=120)
scripts/dev/run_tests.py:72
↓ 9 callers
Method
turbo2_data_bytes
Turbo2 data section bytes (2-bit packed: 4 values per byte).
crates/spark-runtime/src/kv_cache.rs:393
↓ 9 callers
Method
turbo8_data_bytes
Turbo8 data section bytes (FP8 E4M3: 1 byte per element).
crates/spark-runtime/src/kv_cache.rs:404
↓ 9 callers
Method
union_sets
Merge the sets containing `a` and `b` (union by size). # Panics Panics if either element is absent.
crates/xgrammar/src/support/union_find.rs:88
↓ 9 callers
Function
w8a16_gemm
( gpu: &dyn GpuBackend, kernel: KernelHandle, input: DevicePtr, weight: DevicePtr, block_s
crates/spark-model/src/layers/ops/gemm_quant.rs:236
↓ 9 callers
Method
write_kv_cache
( &self, gpu: &dyn GpuBackend, k: DevicePtr, v: DevicePtr, kv_cache: &
crates/spark-model/src/layers/qwen3_attention/decode/write_kv_cache.rs:20
↓ 8 callers
Method
add
Insert `mask` under `key`. Returns `true` if it was stored, `false` if rejected (already present, or larger than the whole budget). Port of `RuleLevel
crates/xgrammar/src/compiler/rule_cache.rs:145
↓ 8 callers
Method
add_tag_dispatch
Add a `TagDispatch` expr. Tag strings and stop/exclude string lists are interned as `ByteString`/`Choices` sub-exprs first, matching the CSR layout de
crates/xgrammar/src/grammar/builder.rs:224
↓ 8 callers
Method
alloc_disk_block_id
(&mut self)
crates/spark-storage/src/stubs.rs:35
↓ 8 callers
Method
alloc_sequence
(&self)
crates/spark-model/src/engine/tests.rs:143
↓ 8 callers
Function
apply_stop_string_holdback
Pure stop-string accumulator + hold-back algorithm. Returns the bytes that should be forwarded to the client this delta; the remainder (≤ `buffer_len`
crates/spark-server/src/api/chat_stream/handle_token.rs:620
↓ 8 callers
Function
b2f
(x: bf16)
crates/spark-storage/src/predictor_ref.rs:18
↓ 8 callers
Function
build_ep_routing_table
Build EP routing table from flattened gate indices and weights. Given the top-K expert assignments for M tokens, partitions them into local vs remote
crates/spark-model/src/layers/ep_dispatch.rs:66
↓ 8 callers
Function
build_jinja_env
Build a precompiled minijinja Environment from the chat template. Leaks the template string to 'static — acceptable since one ChatTokenizer lives for
crates/spark-server/src/tokenizer/jinja_helpers.rs:14
↓ 8 callers
Method
check_async_error
Check the NCCL communicator for asynchronous errors. Returns `true` if the communicator is healthy (no async errors). If an async error is detected,
crates/spark-comm/src/nccl_backend.rs:217
↓ 8 callers
Method
clear
Reject every token (clear all bits).
crates/xgrammar/src/matcher/bitmask.rs:125
↓ 8 callers
Method
commit_verify_state_async
F62 (2026-04-27): commit a verify pass to the canonical SSM state. `num_accepted ∈ [0, k]`: full accept → copy `h_state` → checkpoint; partial → copy
crates/spark-model/src/traits/model.rs:659
↓ 8 callers
Method
compile_builtin_json_grammar
Compile the builtin "any JSON value" grammar. Port of `GrammarCompiler::CompileBuiltinJSONGrammar`.
crates/xgrammar/src/compiler/compiler.rs:182
↓ 8 callers
Method
conv_intermediate
( &self, ssm_layer_idx: usize, slot: usize, token_idx: usize, )
crates/spark-model/src/model/ssm_pool.rs:305
↓ 8 callers
Function
cuEventElapsedTime
crates/atlas-kernels/hip/libcuda_hip_shim.cpp:77
↓ 8 callers
Method
debug_state_checksum
DEBUG (env-gated): PER-LAYER fingerprint of h_state + conv_state for a pool slot, used to prove restore/recompute state divergence. States are FP32 (`
crates/spark-model/src/model/ssm_pool.rs:237
↓ 8 callers
Function
decompose_static_regions
(grammar: &GrammarData)
crates/xgrammar/src/compiler/decompose.rs:280
↓ 8 callers
Function
dense_f32_safe
Load a dense weight, converting FP32 → BF16 if needed. Used for norm weights that may be FP32 in some checkpoints (e.g. Qwen FP8 `linear_attn.norm.wei
crates/spark-model/src/weight_map/model_a.rs:185
↓ 8 callers
Method
effective_attn_scale
Compute effective attention scale: override if set, else `1/sqrt(head_dim)`.
crates/spark-model/src/layers/qwen3_attention/helpers.rs:180
↓ 8 callers
Method
effective_fp8_scales
(&self)
crates/spark-model/src/layers/qwen3_attention/decode.rs:23
↓ 8 callers
Function
enabled
()
crates/spark-model/src/layers/moe/dump.rs:25
↓ 8 callers
Method
epsilon_closure
Epsilon closure (in place); `state_set` is *not* cleared.
crates/xgrammar/src/fsm/compact.rs:105
↓ 8 callers
Function
extract
Find citations in `content` and return an annotation for each reference site. Returns an empty vec when nothing matched.
crates/spark-server/src/citation.rs:63
↓ 8 callers
Function
extract_url_annotations
Scan `content` for http(s) URLs and emit OpenAI-compatible `url_citation` annotations. The extractor handles three shapes: - Markdown links `[title](
crates/spark-server/src/openai/annotations.rs:61
↓ 8 callers
Function
finalize_config
(config: &mut ModelConfig, raw: &serde_json::Value)
crates/atlas-core/src/config.rs:492
↓ 8 callers
Function
gpu_alloc_or_managed
GPU matmul: `C[M,N] = A[M,K] × B[K,N]` using dense_gemm_bf16 kernel. Allocate GPU memory, falling back to managed (UVM) if device alloc fails. Uses a
crates/spark-model/src/mistral_loader.rs:21
↓ 8 callers
Method
h_intermediate
Get fixed-address intermediate h_state for K=2/3/4 verify. `token_idx` is 0..3 (which token in the verify pass).
crates/spark-model/src/model/ssm_pool.rs:295
↓ 8 callers
Function
hc_post
( gpu: &dyn GpuBackend, kernel: KernelHandle, block_out: DevicePtr, residual: DevicePtr, p
crates/spark-model/src/layers/ops/hyper_connection.rs:79
← previous
next →
401–500 of 7,049, ranked by callers