PyTorch HUD API,带MCP支持
Python库和MCP服务器,用于与PyTorch HUD API交互,提供对CI/CD数据、作业日志和分析的访问。
概述
该项目为PyTorch CI/CD分析提供了工具,包括:
- 工作流、作业和测试运行的数据访问
- 大型CI日志的高效日志分析
- ClickHouse查询集成用于分析
- 资源利用率指标
用途(人类)
claude mcp add hud -- $(which uvx) --from "git+https://github.com/izaitsevfb/claude-pytorch-treehugger.git" pytorch-hud发展
# Install dependencies (if not installing with pip)
pip install -r requirements.txt
# Start MCP server
python -m pytorch_hud主要特点
数据访问
get_commit_summary:没有作业的基本提交信息get_job_summary:汇总的作业状态计数get_filtered_jobs:按状态/工作流/名称筛选的作业get_failure_details:带有详细失败信息的失败作业get_recent_commit_status:最近提交的作业统计状态
日志分析
download_log_to_file:将日志下载到本地存储extract_log_patterns:查找错误、警告等。extract_test_results:分析测试执行结果filter_log_sections:提取特定日志部分search_logs:在多个日志中搜索
发展
# Run tests
python -m unittest discover test
# Type checking
mypy -p pytorch_hud -p test
# Linting
ruff check pytorch_hud/ test/文档
- CLAUDE.md:详细的用法、代码风格和实现说明
- mcp-guide.md:通用MCP协议信息
许可证
麻省理工学院
