一键导入
add-dynamic-filter
// Guide for adding dynamic/filter hooks in slime rollout pipeline. Use when user wants sample-group selection during rollout, buffer filtering before training, or per-sample masking/processing hooks.
// Guide for adding dynamic/filter hooks in slime rollout pipeline. Use when user wants sample-group selection during rollout, buffer filtering before training, or per-sample masking/processing hooks.
| name | add-dynamic-filter |
| description | Guide for adding dynamic/filter hooks in slime rollout pipeline. Use when user wants sample-group selection during rollout, buffer filtering before training, or per-sample masking/processing hooks. |
Add filtering hooks in rollout and buffer stages while preserving sample-group contracts.
Use this skill when:
--dynamic-sampling-filter-path--buffer-filter-path--rollout-sample-filter-path--rollout-all-samples-process-pathDynamic sampling filter (called in slime/rollout/sglang_rollout.py):
def filter_function(args, samples, **kwargs):
# return DynamicFilterOutput or bool
Preferred return type:
from slime.rollout.filter_hub.base_types import DynamicFilterOutput
return DynamicFilterOutput(keep=True, reason=None)
Buffer filter (called in slime/rollout/data_source.py):
def buffer_filter(args, rollout_id, buffer, num_samples):
return selected_groups
Rollout sample filter:
def rollout_sample_filter(args, samples):
# modify sample.remove_sample in-place where needed
All-samples process:
def process_all_samples(args, all_samples, data_source):
...
list[list[Sample]] structure intact where required.sample.remove_sample=True over deleting objects.Example wiring:
--dynamic-sampling-filter-path slime.rollout.filter_hub.dynamic_sampling_filters.check_reward_nonzero_std
--buffer-filter-path <module>.buffer_filter
--rollout-sample-filter-path <module>.rollout_sample_filter
--rollout-all-samples-process-path <module>.process_all_samples
rollout_batch_size expectations.slime/rollout/filter_hub/base_types.pyslime/rollout/filter_hub/dynamic_sampling_filters.pyslime/rollout/sglang_rollout.pyslime/rollout/data_source.pyGuide for adding and validating evaluation dataset configuration in slime. Use when user wants to configure eval datasets via --eval-config or --eval-prompt-data, add per-dataset overrides, or customize evaluation rollout behavior.
Guide for adding a custom reward function in slime and wiring it through --custom-rm-path (and optional reward post-processing). Use when user wants new reward logic, remote/service reward integration, or task-specific reward shaping.
Guide for adding a new rollout function in slime and wiring it through --rollout-function-path. Use when user wants to implement custom rollout data generation logic, custom train/eval rollout outputs, or migrate from the default sglang rollout path.
Guide for adding or updating slime tests and CI wiring. Use when tasks require new test cases, CI registration, test matrix updates, or workflow template changes.