Run this model with HF Jobs

Run yuhuanstudio/Yunmo-Next-1B-Base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/yuhuanstudio/Yunmo-Next-1B-Base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
File size: 2,532 Bytes
a9698d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""Instance-scoped dispatch for the long-context KDA training engine."""

from __future__ import annotations

from functools import partial, wraps
from threading import RLock

from .training_engine import TrainingEngineConfig


_KDA_DISPATCH_LOCK = RLock()


def configure_kda_mixer_runtime(mixer, engine: TrainingEngineConfig):
    """Attach the configured KDA call to one mixer without global leakage.

    FLA's ``KimiDeltaAttention.forward`` resolves ``chunk_kda`` from its module
    global at call time.  The research trainer replaced that global once per
    process, which works for a one-model executable but leaks when a process holds
    models with different engines.  This wrapper swaps it only for this bound
    forward and restores it in ``finally``; the custom autograd function owns its
    backward, so the global is not needed after forward returns.
    """

    if not isinstance(engine, TrainingEngineConfig):
        raise TypeError("KDA runtime requires TrainingEngineConfig")
    segment_size = int(engine.recurrent_segment_tokens)
    metadata = {
        "format": "yunmo-next-kda-training-engine-v1",
        "installed": False,
        "segment_size": segment_size,
        "allow_packed_documents": bool(engine.recurrent_packed_documents),
        "official_forward_serial_backward": bool(
            engine.recurrent_official_forward_serial_backward
        ),
    }
    if segment_size == 0:
        mixer._yunmo_kda_training_engine = metadata
        return mixer
    if not (
        engine.recurrent_packed_documents
        and engine.recurrent_official_forward_serial_backward
    ):
        raise RuntimeError("invalid serial recurrent execution configuration")

    import fla.layers.kda as fla_kda_layer

    from .kda_serial import serial_chunk_kda

    engine = partial(
        serial_chunk_kda,
        segment_size=segment_size,
        chunk_size=64,
        allow_packed_documents=True,
        official_forward_serial_backward=True,
    )
    original_forward = mixer.forward

    @wraps(original_forward)
    def forward(*args, **kwargs):
        with _KDA_DISPATCH_LOCK:
            previous = fla_kda_layer.chunk_kda
            fla_kda_layer.chunk_kda = engine
            try:
                return original_forward(*args, **kwargs)
            finally:
                fla_kda_layer.chunk_kda = previous

    mixer.forward = forward
    metadata = {**metadata, "installed": True, "dispatch": "instance_scoped"}
    mixer._yunmo_kda_training_engine = metadata
    return mixer