Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

raydataraydata 搜索

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

210

周安装

9

GitHub Stars

公开资料未说明

下载量

73
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:raydata(raydata 搜索)
来源仓库:https://github.com/serendipityoneinc/srp-claude-code-marketplace
仓库路径:skills/raydata
安装命令:
npx skills add serendipityoneinc/srp-claude-code-marketplace --skill "raydata"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add serendipityoneinc/srp-claude-code-marketplace --skill "raydata"

简介

raydata 用于辅助数据整理、表格分析和统计口径生成。

  • 它适合清洗字段、汇总数据、发现异常或准备图表素材。
  • 使用时需确认数据来源和时间范围,避免将样本当全量事实。
  • 涉及敏感数据导出时应先确认脱敏方式和权限边界。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • raydata 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
raydata
description
Write, test, deploy, and troubleshoot Ray Data jobs for large-scale data processing with GPU/CPU coordination

Ray Data Job Development

Help developers build, test, deploy, and debug Ray Data jobs at SRP. Ray Data is designed for large-scale ML workloads with distributed CPU/GPU coordination.

When to Use This Skill

Use this skill when:

  • Writing new Ray Data jobs for batch inference, data preprocessing, or ETL
  • Testing Ray Data code locally or on GPU clusters
  • Deploying jobs to production RayCluster
  • Debugging performance issues or failures
  • Setting up scheduled jobs in Airflow

Development Workflow

1. Local Development on A10

Environment Setup:

# Connect to A10 development machine
ssh oci-dev2.ssh.buildagi.us  # A102 dev machine
# OR
ssh oci-dev3.ssh.buildagi.us  # A103 dev machine

# Create virtual environment
python3 -m venv my_venv
source my_venv/bin/activate

# Install Ray Data and dependencies
pip install ray[data]
pip install transformers Pillow torch  # Add other dependencies as needed

Development Tips:

  • Use VSCode/Cursor for remote editing
  • Always use virtualenv to avoid dependency conflicts
  • Store code in /data/srp/raydata/code/ for RayCluster visibility
  • Test with small datasets first

Running Locally:

# Simple Python execution
python /data/srp/raydata/code/your-job.py

When to Use Local Development:

  • Initial code writing and debugging
  • Jobs that don't require GPU
  • Models that fit in A10 GPU memory (~24GB)

2. Testing on Slurm H100/H200

When models are too large for A10 or require more GPU memory:

# Connect to Slurm cluster
ssh -p 2222  [email protected] 

# Start apptainer with H100/H200 GPU
sapptainer -c 20 -m 200G -g 1 -p h100 -i /data/srp/apptainer/ray_2.52.0-py310-gpu.sif

# Run your job inside apptainer
python /data/srp/raydata/code/your-job.py

Use Slurm Testing For:

  • Large models (e.g., Qwen3-VL-8B-Instruct-FP8)
  • GPU-intensive workloads
  • Final testing before production

3. Production Deployment on RayCluster

Setup Ray Client:

# On your Mac or any machine with Ray installed
conda create -n ray python=3.10 -y
conda activate ray
pip install -U "ray[all]"

# Set RayCluster address
export RAY_ADDRESS="https://ray.g.yesy.online"

Submit Job:

ray job submit \
  --runtime-env-json='{
    "pip": ["torch", "torchvision", "transformers"],
    "env_vars": {
      "INPUT_PATH": "s3://bucket/path/to/input",
      "OUTPUT_PATH": "/data/srp/project/output"
    }
  }' \
  -- python /data/srp/raydata/code/your-job.py

Runtime Environment Parameters:

  • pip: List of Python packages to install
  • env_vars: Environment variables (input/output paths, configs)

Important Notes:

  • Code must be in /data/srp/ (mounted via JuiceFS)
  • RayCluster provides auto-scaling, failover, and job scheduling
  • Dashboard: https://ray.g.yesy.online/

4. Scheduled Jobs in Airflow

For periodic execution, use Airflow BashOperator:

operator: airflow.operators.bash.BashOperator
bash_command: |-
    echo "Installing ray[data]..."
    pip install ray[data]
    ~/.local/bin/ray job submit \
      --runtime-env-json='{"pip": ["torch"], "env_vars": {"INPUT_PATH": "..."}}' \
      -- python /data/srp/raydata/code/your-job.py

env:
    RAY_ADDRESS: "https://ray.g.yesy.online"
dependencies:
    - start

Reference: https://github.com/SerendipityOneInc/favie-data-etl/tree/main/dags/raydata_job_demo

Code Structure

Basic Ray Data Pipeline

import os
import ray

# 1. Initialize Ray session
ray.init()

# 2. Load data
# From S3
ds = ray.data.read_parquet("s3://bucket/path/*.parquet")
# From JuiceFS
ds = ray.data.read_parquet("/data/srp/project/data/*.parquet")
# Images
ds = ray.data.read_images("s3://bucket/images/", mode="RGB")

# 3. Transform data
ds = ds.map_batches(
    YourProcessor,
    compute=ray.data.ActorPoolStrategy(size=1),
    num_gpus=1,
    batch_size=16
)

# 4. Save results
ds.write_parquet("/data/srp/project/output/")

Processor Class Pattern

Simple Function UDF:

def process_batch(batch):
    # Process batch data
    batch["result"] = [compute(item) for item in batch["input"]]
    return batch

ds = ds.map_batches(process_batch, batch_size=32)

Model-Based Processor (Recommended):

from typing import Dict
import numpy as np
from transformers import pipeline
from PIL import Image

BATCH_SIZE = 16

class ImageClassifier:
    def __init__(self):
        # Load model once in __init__
        self.classifier = pipeline(
            "image-classification",
            model="google/vit-base-patch16-224",
            device=0  # GPU device
        )

    def __call__(self, batch: Dict[str, np.ndarray]):
        # Convert numpy arrays to PIL Images
        images = [Image.fromarray(img) for img in batch["image"]]

        # Run inference
        outputs = self.classifier(
            images,
            top_k=1,
            batch_size=BATCH_SIZE
        )

        # Add results to batch
        batch["score"] = [out[0]["score"] for out in outputs]
        batch["label"] = [out[0]["label"] for out in outputs]
        return batch

# Use with ActorPoolStrategy for GPU efficiency
predictions = ds.map_batches(
    ImageClassifier,
    compute=ray.data.ActorPoolStrategy(size=1),  # Number of GPU replicas
    num_gpus=1,  # GPUs per replica
    batch_size=BATCH_SIZE
)

Using vLLM for Batch Inference

from ray.data.llm import LLMPredictor, vLLMEngineProcessorConfig

model_id = "meta-llama/Llama-3.1-8B-Instruct"

processor = vLLMEngineProcessorConfig(
    model_id=model_id,
    tensor_parallel_size=1,
    max_model_len=2048,
    max_num_batched_tokens=4096
)

ds = ds.map_batches(
    LLMPredictor,
    fn_constructor_kwargs={"processor": processor},
    num_gpus=1,
    batch_size=32
)

Best Practices

Performance Optimization

  1. Batch Sizing:

- Use largest batch size that fits in GPU memory - Larger batches = better GPU utilization - Start with batch_size=16, increase until OOM

  1. Concurrent Processing:

- Separate CPU preprocessing from GPU inference - Use multiple map_batches operations - Enables parallel preprocessing while inference runs

  1. GPU Utilization:

- Set num_gpus=1 per actor - Use ActorPoolStrategy(size=N) for N GPU replicas - Match replicas to available GPUs in cluster

  1. Memory Management:

- Monitor memory usage in Ray dashboard - Reduce batch_size if hitting OOM - Use smaller models or more capable GPUs

Error Handling

# Set AWS region to avoid endpoint resolution issues
import os
if "AWS_DEFAULT_REGION" not in os.environ:
    os.environ["AWS_DEFAULT_REGION"] = "us-east-1"

# Use environment variables for paths
input_path = os.environ.get("INPUT_PATH", "default/path")
output_path = os.environ.get("OUTPUT_PATH", "default/output")

# Add error handling in processor
class RobustProcessor:
    def __call__(self, batch):
        try:
            # Process batch
            return batch
        except Exception as e:
            print(f"Error processing batch: {e}")
            # Add error column or skip
            batch["error"] = str(e)
            return batch

Monitoring & Debugging

Ray Dashboard

Access dashboard at: https://ray.g.yesy.online/

Key Metrics:

  • Job Status: Running/completed/failed jobs
  • Cluster Nodes: Available GPUs, CPU, memory
  • Task Timeline: Per-task execution time
  • Operator Metrics: Throughput, batch processing time
  • Resource Usage: GPU utilization, memory pressure

Viewing Job Logs

# List jobs
ray job list

# Get job logs
ray job logs <job_id>

# Follow logs in real-time
ray job logs <job_id> --follow

Common Issues

IssueCauseSolution
GPU OOMBatch too largeReduce batch_size
CPU OOMToo many concurrent actorsIncrease num_cpus per actor
Slow preprocessingSequential processingSeparate into distinct map operations
Low GPU utilizationBatch too smallIncrease batch_size
Model loading failsMissing dependenciesAdd to runtime-env-json pip list
S3 access errorsMissing AWS regionSet AWS_DEFAULT_REGION env var

Debug Mode

# Run with local mode for debugging
ray.init(local_mode=True)  # Single-process execution

# Take small sample for testing
sample = ds.take(10)  # Get 10 items
print(sample)

# Limit data for quick tests
ds = ds.limit(100)  # Process only 100 items

Example Workflows

1. Image Classification

import os
import ray
from transformers import pipeline
from PIL import Image

ray.init()

ds = ray.data.read_images(
    os.environ.get("INPUT_PATH", "s3://bucket/images/"),
    mode="RGB"
)

class ImageClassifier:
    def __init__(self):
        self.classifier = pipeline(
            "image-classification",
            model="google/vit-base-patch16-224",
            device=0
        )

    def __call__(self, batch):
        images = [Image.fromarray(img) for img in batch["image"]]
        outputs = self.classifier(images, top_k=1, batch_size=16)
        batch["label"] = [out[0]["label"] for out in outputs]
        batch["score"] = [out[0]["score"] for out in outputs]
        return batch

predictions = ds.map_batches(
    ImageClassifier,
    compute=ray.data.ActorPoolStrategy(size=1),
    num_gpus=1,
    batch_size=16
)

predictions.write_parquet(
    os.environ.get("OUTPUT_PATH", "/data/srp/output/")
)

2. Vision-Language Model (Qwen-VL)

import os
import ray
import torch
from transformers import AutoProcessor, AutoModelForVision2Seq
from PIL import Image
from qwen_vl_utils import process_vision_info

ray.init()

ds = ray.data.read_images(
    os.environ.get("INPUT_PATH", "s3://bucket/images/"),
    mode="RGB"
)

PROMPT = os.environ.get(
    "PROMPT",
    "请详细描述这张图片中的内容,包括主要对象、场景和任何值得注意的细节。"
)

class QwenVLAnalyzer:
    def __init__(self):
        model_name = "Qwen/Qwen3-VL-8B-Instruct-FP8"
        self.processor = AutoProcessor.from_pretrained(model_name)
        self.model = AutoModelForVision2Seq.from_pretrained(
            model_name,
            torch_dtype=torch.float16,
            device_map="auto"
        )
        self.model.eval()

    def __call__(self, batch):
        images = [Image.fromarray(img) for img in batch["image"]]

        messages_list = [
            [{
                "role": "user",
                "content": [
                    {"type": "image", "image": img},
                    {"type": "text", "text": PROMPT}
                ]
            }]
            for img in images
        ]

        image_inputs, video_inputs = process_vision_info(messages_list)
        texts = self.processor.apply_chat_template(
            messages_list,
            tokenize=False,
            add_generation_prompt=True
        )

        inputs = self.processor(
            text=texts,
            images=image_inputs,
            videos=video_inputs,
            padding=True,
            return_tensors="pt"
        ).to(self.model.device)

        with torch.no_grad():
            generated_ids = self.model.generate(**inputs, max_new_tokens=512)
            generated_ids_trimmed = [
                out[len(inp):]
                for inp, out in zip(inputs.input_ids, generated_ids)
            ]
            output_texts = self.processor.batch_decode(
                generated_ids_trimmed,
                skip_special_tokens=True,
                clean_up_tokenization_spaces=False
            )

        batch["description"] = output_texts
        return batch

predictions = ds.map_batches(
    QwenVLAnalyzer,
    compute=ray.data.ActorPoolStrategy(size=1),
    num_gpus=1,
    batch_size=20
)

predictions.write_parquet(
    os.environ.get("OUTPUT_PATH", "/data/srp/output/")
)

3. Batch Inference with vLLM

Reference: https://github.com/SerendipityOneInc/ray-data-etl/blob/main/jobs/demo/raydata-demo-qwenvl-vllm.py

4. HTTP API Inference

Reference: https://github.com/SerendipityOneInc/ray-data-etl/blob/main/jobs/demo/raydata-demo-qwenvl-http.py

Resources

Official Documentation

  • Ray Data Quickstart: https://docs.ray.io/en/latest/data/quickstart.html
  • Working with LLMs: https://docs.ray.io/en/latest/data/working-with-llms.html
  • Batch Inference: https://docs.ray.io/en/latest/data/batch_inference.html
  • Loading Data: https://docs.ray.io/en/releases-2.52.0/data/loading-data.html
  • Transforming Data: https://docs.ray.io/en/releases-2.52.0/data/transforming-data.html
  • Working with Images: https://docs.ray.io/en/releases-2.52.0/data/working-with-images.html
  • Runtime Environments: https://docs.ray.io/en/latest/ray-core/handling-dependencies.html

SRP Resources

  • RayData Wiki: https://starquest.feishu.cn/wiki/Kpb3w8MNZieJGkkMhbqcIkrTnTc
  • ray-data-etl Project: https://github.com/SerendipityOneInc/ray-data-etl
  • RayCluster Dashboard: https://ray.g.yesy.online/
  • Airflow Examples: https://github.com/SerendipityOneInc/favie-data-etl/tree/main/dags/raydata_job_demo

Quick Reference

Common Commands

# Local development
ssh oci-dev2.ssh.buildagi.us
python3 -m venv venv && source venv/bin/activate
pip install ray[data]

# Slurm testing
ssh -p 2222  [email protected] 
sapptainer -c 20 -m 200G -g 1 -p h100 -i /data/srp/apptainer/ray_2.52.0-py310-gpu.sif

# Production submission
export RAY_ADDRESS="https://ray.g.yesy.online"
ray job submit --runtime-env-json='...' -- python /data/srp/raydata/code/job.py

# Monitoring
ray job list
ray job logs <job_id> --follow

File Locations

  • Code storage: /data/srp/raydata/code/
  • Output storage: /data/srp/project/output/
  • Apptainer images: /data/srp/apptainer/

Implementation Steps

When helping users with Ray Data jobs, follow this workflow:

  1. Understand Requirements:

- What type of processing? (inference, ETL, preprocessing) - Input data source and format - Model requirements (GPU memory, batch size) - Expected output format

  1. Choose Development Environment:

- Start with A10 local development for testing - Move to Slurm H100/H200 if needed for larger models - Deploy to RayCluster for production scale

  1. Write Code:

- Use the processor class pattern - Include proper error handling - Use environment variables for paths - Start with small batch sizes

  1. Test Iteratively:

- Test with .take(10) or .limit(100) first - Verify output format - Check resource usage in dashboard - Optimize batch size and concurrency

  1. Deploy to Production:

- Submit to RayCluster with proper runtime-env - Monitor via dashboard - Set up Airflow scheduling if needed

  1. Debug Issues:

- Check Ray dashboard for errors - Review job logs - Adjust batch size or resources - Consult troubleshooting table

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.95%
按下载量换算22

kilo

22.93%
按下载量换算17

windsurf

18.31%
按下载量换算13

zencoder

13.28%
按下载量换算10

cline

7.99%
按下载量换算6

pi

3.42%
按下载量换算2

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills