Home/Algo Bridge/Sliding Window Framework/LC_3
⚡ Practice in Flashcards
🌉 Problem-Level AI BridgeLC_3 · 中等

LC_3 (Longest Substring Without Repeating Characters) ➔ Online Tiled Softmax (Safe Exponent Streaming)

Sliding window algorithms maintain rolling contiguous state over unbounded sequences, maintaining strict boundary invariants.

1️⃣ 1️⃣ Classical DSA Origin

LC_3 · Longest Substring Without Repeating Characters

Pattern: Sliding Window Framework — Maintains continuous invariant state across a dynamic sequence. Right pointer expands the active window to incorporate new tokens; when boundary constraints are violated, left pointer shrinks the window, ensuring each element enters and exits at most once for O(N) amortized runtime.

⚡ Open LC-3 Solution ➔
2️⃣ 2️⃣ Production AI System Transfer

FlashAttention & Online Softmax SRAM Tiled Acceleration · Online Tiled Softmax (Safe Exponent Streaming)

Industrial Application: Enables sliding window attention (Mistral) and rolling KV cache management to bound memory footprint in long-context streaming.

🧬 Target AI Kernel Interface
def online_softmax(x: torch.Tensor, chunk_size: int = 4) -> torch.Tensor

🔗 Related Algorithmic Bridges

LC_3 ➔ FlashAttention: Tiled Matrix Multiplication Kernel
Sliding window algorithms maintain rolling contiguous state over unbound...
LC_3 ➔ Sliding Window Attention (Mistral Style)
Sliding window algorithms maintain rolling contiguous state over unbound...
LC_42 ➔ Online Tiled Softmax (Safe Exponent Streaming)
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_42 ➔ FlashAttention: Tiled Matrix Multiplication Kernel
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_42 ➔ Sliding Window Attention (Mistral Style)
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_239 ➔ Online Tiled Softmax (Safe Exponent Streaming)
Algorithmic foundation connecting classic data structures to LLM high-pe...
← LC_15 (3sum) → Low-bit Quantization (INT4 / NF4) & Bit Unpacking KernelsLC_3 (Longest Substring Without Repeating Characters) → FlashAttention & Online Softmax SRAM Tiled Acceleration →