Show HN: AI-related Jax module (I hate if)

PJHkorea2 pts3 comments

GitHub - PJHkorea/egregore-core-jax: High-performance, branchless numerical stability kernels and compiler-optimized core infrastructure for advanced JAX/XLA deep learning architectures. ยท GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

PJHkorea

egregore-core-jax

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>25 Commits<br>25 Commits

egregore_core_jax

egregore_core_jax

LICENSE

LICENSE

README.md

README.md

pyproject.toml

pyproject.toml

View all files

Repository files navigation

๐Ÿงฉ Core Modules Specifications (ํ•ต์‹ฌ ๋ชจ๋“ˆ ๋ช…์„ธ)

1. ๐Ÿ› ๏ธ optimizers.py โ€” Branchless PyTree LLRD Engine

JAX/Optax ์œ ์ €๋“ค์„ ์œ„ํ•ด ์ธํ„ฐํ”„๋ฆฌํ„ฐ์˜ ์กฐ๊ฑด ๋ถ„๊ธฐ ๊ฐœ์ž…์„ ์ œ๊ฑฐํ•œ ์ดˆ๊ณ ์† ๊ณ„์ธต๋ณ„ ์ฐจ๋“ฑ ์ตœ์ ํ™”(LLRD) ํŒฉํ† ๋ฆฌ ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.

[KR] ๋ชฉ์  ๋ฐ ๊ธฐ๋Šฅ : ๋ณต์žกํ•œ PyTree ๊ฐ€์ค‘์น˜ ์‚ฌ์ „ ์Šค์บ” ์‹œ ๋ฐœ์ƒํ•˜๋˜ ํŒŒ์ด์ฌ ํ˜ธ์ŠคํŠธ ์˜ค๋ฒ„ํ—ค๋“œ์™€ hasattr ๋ถ„๊ธฐ ์˜ˆ์ธก ์‹คํŒจ(Branch Stall)๋ฅผ 'getattr ์˜ค๋ฆฌ ํƒ€์ดํ•‘ ์†์„ฑ ๋งˆ์Šคํ‚น'๊ณผ '์‚ผํ•ญ ๋Œ€์ˆ˜์‹ ๋งˆ์Šคํฌ'๋ฅผ ํ†ตํ•ด ํ‰ํƒ„ํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋นˆ ๊ฒฝ๋กœ ์œ ์ž… ํฌ๋ž˜์‹œ๋ฅผ ๋ฐฉ์–ดํ•˜๋Š” safe_path ์œตํ•ฉ ๊ธฐ์ˆ ์ด ํƒ‘์žฌ๋˜์–ด ์žˆ์œผ๋ฉฐ, custom_router ์˜์กด์„ฑ ์ฃผ์ž…(DI)์„ ์ง€์›ํ•˜์—ฌ LLM ๋“ฑ ๋ชจ๋“  JAX ๋ชจ๋ธ์— ๋ฒ”์šฉ ๊ฒฐํ•ฉ์„ ์œ„ํ•จ์ด ๋ชฉ์ ์ž…๋‹ˆ๋‹ค.

[EN] Purpose & Function : A high-velocity Layer-wise Learning Rate Decay (LLRD) factory module crafted to eliminate conversational python interpreter overhead for JAX/Optax developers. It flattens the conventional hasattr branch stalls during complex PyTree scanning by utilizing 'getattr Duck-Typing Attribute Masking' and inline algebraic string-matching. Equipped with a robust safe_path concatenation technique to safeguard against empty path crashes, it offers a custom_router dependency injection interface for universal integration into any JAX-based architecture, including LLMs.

๐Ÿ’ก TL;DR (ํ•ต์‹ฌ ์š”์•ฝ) :

[KR] ๋ฌธ์ œ์™€ ํ•ด๋ฒ• : JAX์—์„œ ๋ ˆ์ด์–ด๋ณ„๋กœ ํ•™์Šต๋ฅ ์„ ๋‹ค๋ฅด๊ฒŒ ์ค„ ๋•Œ(LLRD), ๊ฐ€์ค‘์น˜ ํŠธ๋ฆฌ ๊ฒฝ๋กœ๋ฅผ ์Šค์บ”ํ•˜๋А๋ผ ํŒŒ์ด์ฌ์˜ if/else ์กฐ๊ฑด๋ฌธ์„ ์“ฐ๊ฒŒ ๋˜๋ฉด GPU/TPU ์ปดํŒŒ์ผ ๊ทธ๋ž˜ํ”„๊ฐ€ ์กฐ๊ฐ๋‚˜๊ณ  ๋ณ‘๋ชฉ์ด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ชจ๋“ˆ์€ ์กฐ๊ฑด ๋ถ„๊ธฐ๋ฅผ ์™„์ „ํžˆ ํŒŒ๊ดดํ•˜๊ณ  "gate" * (is_gate) + "backbone" * (not_is_gate) ๊ฐ™์€ ์ธ๋ผ์ธ ๋Œ€์ˆ˜์‹ ๋ฌธ์ž์—ด ์—ฐ์‚ฐ ๋งŒ์œผ๋กœ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ํ•˜๋“œ์›จ์–ด ๋ ˆ๋ฒจ์—์„œ ์ดˆ๊ณ ์† ๋ผ์šฐํŒ…ํ•ฉ๋‹ˆ๋‹ค.

[EN] Problem & Solution : When implementing Layer-wise Learning Rate Decay (LLRD) in JAX, using standard Python if/else predicates to scan weight tree paths fragments the GPU/TPU compilation graph and triggers severe branch stalls. This module thoroughly obliterates conditional branching, utilizing inline algebraic string-manipulation like "gate" * (is_gate) + "backbone" * (not_is_gate) to execute ultra-high-speed parameter routing natively within hardware-level constraints.

๐Ÿš€ [Update] Production-Ready Enterprise Silicon MUX Architecture :

[KR] ์ง„ํ™”๋œ ํ•ต์‹ฌ ์‚ฌ์–‘ : ์ƒ์œ„ ํ”„๋ ˆ์ž„์›Œํฌ(Optax)์˜ ๋ฌธ์ž์—ด ๊ธฐ๋ฐ˜ ๋”•์…”๋„ˆ๋ฆฌ ๋ผ์šฐํŒ… ์ œ์•ฝ๋งˆ์ € ์ „์‚ฐํ•™์ ์œผ๋กœ ์™„์ „ํžˆ ๋ฐ•๋ฉธํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ถˆ๋ฆฐ ๊ฒฐ๊ณผ๊ฐ’(True/False)์— ๊ณง๋ฐ”๋กœ * 1.0f ๋Œ€์ˆ˜ ์—ฐ์‚ฐ์„ ์œ ๋„ํ•˜์—ฌ ๊ฐ€์†๊ธฐ ALU ๋‹จ์ถ• ๋ ˆ์ง€์Šคํ„ฐ๊ฐ€ ์†Œ๋ชจํ•  ์ˆ˜ ์žˆ๋Š” float32 ์ •์  ๋ฆฌํ„ฐ๋Ÿด ๋งˆ์Šคํฌ๋กœ ์ฆ‰์‹œ ์••์ถ•(is_gate = (root_key_name == "gate") * 1.0f)ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์ค‘ ์˜ตํ‹ฐ๋งˆ์ด์ € ๋ถ„๊ธฐ ์ฒด์ธ์„ ์™„์ „ํžˆ ์†Œ๋ฉธ์‹œํ‚ค๊ณ , ๋‹จ์ผ ๊ธฐ์ € AdamW ์œ„์—์„œ ๊ฐ€์†๊ธฐ ๋‚ด๋ถ€์˜ ๋‹จ์ผ ํด๋Ÿญ ์•„๋‹ค๋งˆ๋ฅด ๊ณฑ(Hadamard Product) ํ…์„œ ์—ฐ์‚ฐ๋งŒ์œผ๋กœ ์—…๋ฐ์ดํŠธ ์Šค์ผ€์ผ์„ ์ œ์–ดํ•˜์—ฌ XLA ์ปดํŒŒ์ผ๋Ÿฌ๊ฐ€ ์˜จ์นฉ SRAM ๋‚ด๋ถ€์— ์ตœ์ ์˜ ๋‹จ์ผ ์œตํ•ฉ ์ปค๋„(Fused Kernel)์„ ๊ฐ•์ œ ํฌ๋ฉ”์ด์…˜ํ•˜๋„๋ก ๋ฆฌ์—”์ง€๋‹ˆ์–ด๋ง๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

[EN] Advanced Evolution Mechanics : Fundamentally extinguishes framework-level string dictionary routing. By directly appending * 1.0f to boolean evaluations, it compresses dynamic states into float32 literal register masks (is_gate = (root_key_name == "gate") * 1.0f) tailored for the accelerator ALU. This demolishes multi-optimizer branch chains, consolidating execution onto a unified underlying AdamW engine where layer-wise scaling is driven strictly via single-cycle inline Hadamard tensor products, forcing the XLA compiler to generate high-density Fused Kernels directly inside on-chip SRAM.

2. ๐Ÿ“ geometry.py โ€” Static Virtual View Curvature Sensor

๋‹ค์ฐจ์› ๋ฐฐ์น˜ ์ž…๋ ฅ์˜ ์œ ๋™์ ์ธ ํ™•์žฅ ์†์—์„œ๋„ ์ •์  ์ปดํŒŒ์ผ ๋ฌด๊ฒฐ์„ฑ์„ ๋ชฉํ‘œ๋กœ ํ•˜๋Š” ๊ณ ์† ๋‹ค์–‘์ฒด ๊ณก๋ฅ (๊ณต๊ฐ„ ๋ถ„์‚ฐ) ๊ณ„์ธก ๋ชจ๋“ˆ์ž…๋‹ˆ๋‹ค.

[KR] ๋ชฉ์  ๋ฐ ๊ธฐ๋Šฅ : JAX ํ™˜๊ฒฝ์—์„œ jnp.reshape๋‚˜ ์ฐจ์› ํŠœํ”Œ ์กฐ๋ฆฝ ์‹œ ์œ ์ €๋“ค์˜ ๊ณจ์น˜๋ฅผ ์ฉ์ด๋˜ ํ˜•์ƒ ์ถ”์  ์—๋Ÿฌ(ConcretizationTypeError)๋ฅผ static_argnums=(1,) ์ •์  ์ƒ์ˆ˜ ๋ฝ(Lock) ๊ฐ€๋“œ๋ ˆ์ผ๋กœ ๋ง‰์•„๋ดค์Šต๋‹ˆ๋‹ค. ์ž„์˜์˜ N์ฐจ์› ๋ฐฐ์น˜ ์ž…๋ ฅ([B, D], [B, T, D] ๋“ฑ)์ด ์ธ์ž…๋˜๋”๋ผ๋„ ๋‹จ์ผ ์ •์  ๊ฐ€์ƒ ๋ทฐ ๋ ˆ๋ฒจ์˜ ์ธ๋ผ์ธ ์—ฐ์† ๋ฉ”๋ชจ๋ฆฌ ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ํ•˜๋“œ์›จ์–ด ์˜จ์นฉ ๋ฆฌ๋•์…˜ ์†๋„๋ฅผ ๊ทน๋Œ€ํ™”ํ•จ์ด ๋ชฉ์ ์ž…๋‹ˆ๋‹ค.

[EN] Purpose & Function : A high-efficiency spatial macro-curvature (geometric variance proxy) measurement module engineered to maintain static compilation integrity across fluid multi-dimensional batch scaling. To shield developers from stubborn tracer crashes...

high search llrd module core branch

Related Articles