소스 정보
- 저장소
- marin-community/marin
- 최근 소스 활동
- 2026년 8월 8일 03:36
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1,266
- 포크
- 147
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/marin-community/marin --skill add-pallas-kernel명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Scheduled scrub: TL;DR blocks on experiment issues.
Launch, monitor, hand off, resume, rollback, or babysit expensive Marin production. Typically >=1e22 model flops.
Lint, run the pre-PR checks, commit, push, and author or update the branch's pull request in the required plain-text format. Use when committing, pushing, or creating/updating a PR.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | add-pallas-kernel |
| description | Add, modify, or autotune a TPU/GPU Pallas kernel. |
Use this skill to build or change Pallas kernels with explicit standards for reference numerics, gradient safety, backend/fallback API design, performance measurement, and block-size autotuning.
.agents/skills/run-research/SKILL.md
first.docs/reference/; read them only when the
routed detail files point there.For a kernel K, produce:
The general flow is: make it right, make it fast, make it usable, make it easy to use.
Use an existing in-repo implementation, pseudocode, a PyTorch reference, or a JAX baseline. The baseline must be obvious and stable, not clever. If the naive baseline would materialize huge intermediates, use a streaming/blockwise baseline with identical math.
Minimum checks:
allclose.Use explicit shape/dtype annotations for public APIs and references, such as
jaxtyping, where available.
For in-tree kernels, add or extend tests under lib/levanter/tests/kernels/.
Compare the default implementation against the reference on small CPU shapes and
accelerator-aligned shapes for fast paths. Read TESTING.md and the nearest
module AGENTS.md before writing or changing tests.
Once the reference is correct, design the Pallas implementation. Use the reference as both a correctness oracle and a performance baseline.
Use existing kernels for structure and API inspiration. Read Kernel sources unless the user already named the specific kernel to follow. Unless there is a stronger local pattern, start by reimplementing the reference in Pallas.
Wrap accelerator kernel boundaries in an explicit jax.shard_map by default.
This applies to pl.pallas_call, Mosaic GPU kernels, and custom FFI calls.
Reshard inputs to the intended local PartitionSpec before the shard_map,
keep the sequence or other nonlocal dimensions unsharded unless the kernel is
explicitly written for them, and add a regression check that the lowered JAXPR
or HLO contains the expected shard_map. Do not rely on XLA to infer a good
sharding for an opaque kernel call boundary. Exceptions are limited to wrappers
whose inputs are explicitly documented and tested as fully local or replicated.
Check correctness against the harness and reference implementation before tuning. Once the kernel is correct, run a performance harness on representative shapes/dtypes and compare against the roofline. If performance is not near the expected roofline, read Performance workflow and investigate compiler dumps, pressure signals, and tile choices before broad rewrites.
Read API patterns before adding or changing the public wrapper, backend selection, block-size config, or input normalization contract. Keep the reference/XLA path usable even when accelerator-specific constraints are not met. Keep backend-specific validation in backend-specific modules.
Add cost_estimate= to each pl.pallas_call:
pl.estimate_cost on a body-equivalent JAX function, not a kernel body
with pl.program_id.from levanter.kernels.pallas.cost_estimate_utils import with_io_bytes_accessed
def _cost_estimate(
q: jax.Array,
k: jax.Array,
v: jax.Array,
*,
kernel_inputs_specs,
kernel_outputs_specs,
) -> pl.CostEstimate | None:
body_cost = pl.estimate_cost(reference_impl, q, k, v)
return with_io_bytes_accessed(
body_cost,
kernel_inputs_specs=kernel_inputs_specs,
kernel_outputs_specs=kernel_outputs_specs,
)
shard_map, or
its wrapper documents and tests why the inputs are fully local or replicated.
Tests or profile evidence show it did not lower through unintended
all-gathers.pl.pallas_call has a reviewed cost_estimate=.run-research workflow when the task is long-running.shard_map boundary when
operating on sharded inputs.