Kernel Analyzer checks warp kernels to ensure correctness and conformity. It comes with both a CLI (which can be used within github CI) and also a vscode plugin for automatic kernel issue highlighting.
python contrib/kernel_analyzer/kernel_analyzer/cli.py mujoco_warp/_src/*.py --types mujoco_warp/_src/types.py python contrib/kernel_analyzer/kernel_analyzer/cli.py mujoco_warp/_src/*.py --types mujoco_warp/_src/types.py --output=githubEnjoy kernel analysis directly within vscode.
- Create a new python env (
python3 -m venv env) or use your existing mjwarp env (source env/bin/activate). - Within the python env, install the kernel analyzer's python dependencies by pip installing MJWarp dev:
cd mujoco_warp
pip install -e .[dev]- Inside vscode, navigate to
contrib/kernel_analyzer/ - Right click on
kernel-analyzer-{version}.vsixfile - Select "Install Extension VSIX"
- Open vscode settings and navigate to
Extensions > Kernel Analyzer - Set Python Path to the
bin/pythonof the env you set up in step 1, e.g./home/$USER/work/mujoco_warp/env/bin/python - Set Types Path to the location of
types.pyin your checked out code, e.g./home/$USER/work/mujoco_warp/mujoco_warp/_src/types.py
Create a debug configuration in .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/contrib/kernel_analyzer"
],
"name": "Launch Extension",
"outFiles": [
"${workspaceFolder}/contrib/kernel_analyzer/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
"request": "launch",
"type": "extensionHost",
}
]
}npm run package