命令行界面

FlashInfer 提供了一个命令行界面,用于管理模块、制品和开发工具。

快速参考

查看所有可用命令

flashinfer --help

导出编译命令

开发者须知: 生成一个 compile_commands.json 文件,以便与 clangd 或 ccls 等语言服务器集成到 IDE 中

# Export to default location (compile_commands.json)
flashinfer export-compile-commands

# Export to a specific path
flashinfer export-compile-commands my_compile_commands.json

# Or use the --output option
flashinfer export-compile-commands --output /path/to/output.json

此编译数据库可以实现

  • IDE 中的代码补全和导航

  • 静态分析工具集成

  • 更好的 CUDA/C++ 代码开发体验

模块管理

列出和检查编译模块

# List all available modules
flashinfer list-modules

# Show details for a specific module
flashinfer list-modules module_name

# Show compilation status for all modules
flashinfer module-status

# Show detailed status with filters
flashinfer module-status --detailed
flashinfer module-status --filter compiled
flashinfer module-status --filter not-compiled

配置和状态

显示 FlashInfer 配置和安装状态

flashinfer show-config

这会显示

  • FlashInfer 版本和已安装的软件包

  • PyTorch 和 CUDA 版本信息

  • 环境变量和制品路径

  • 已下载 cubin 的状态和模块编译状态

制品管理

管理预编译的 CUDA 二进制文件

# Download pre-compiled cubins
flashinfer download-cubin

# List downloaded cubins
flashinfer list-cubins

# Clear downloaded cubins
flashinfer clear-cubin

缓存管理

清除 JIT 编译缓存

flashinfer clear-cache