Skip to content

Commit a102b71

Browse files
authored
Revise performance guidelines and backend references
Updated performance guidelines and backend list in instructions.
1 parent 124cb3a commit a102b71

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/copilot-instructions.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Emulate NumPy user-facing API as much as possible.
2121

2222
**Uses pre-commit with ruff**
2323

24+
**Performance**
25+
* Could should be performant
26+
* Avoid expensive work in hot loops
27+
* Avoid redundant checks. Let errors raise naturally
28+
* In contrast, silent errors should be prevented
29+
2430
**Comments**: Should be used sparingly, only for complex logic
2531

2632
**Testing**: Should be succinct
@@ -44,7 +50,7 @@ Emulate NumPy user-facing API as much as possible.
4450
- `gradient.py`: Auto-differentiation
4551
- `compile/`: Function compilation
4652
- `graph/`: IR and optimization (`graph/rewriting/`)
47-
- `link/`: Backends (`c/`, `jax/`, `numba/`, `pytorch/`)
53+
- `link/`: Backends (`c/`, `jax/`, `numba/`, `mlx/`, `pytorch/`)
4854
- `tensor/`: Tensor ops (largest module, subdirs: `random/`, `rewriting/`, `conv/`)
4955
- `scalar/`: Scalar ops
5056
- `scan/`: Loop operations (`scan_perform.pyx` Cython)
@@ -74,7 +80,7 @@ micromamba run -n pytensor-test python -m pytest tests/ --runslow # Include s
7480

7581
Tests are run with `config.floatX == "float32"` and `config.mode = "FAST_COMPILE"`. If needed:
7682
- Cast numerical values `test_value.astype(symbolic_var.type.dtype)`
77-
- Use custom function mode `get_default_mode().excluding("fusion")` or skip tests in `FAST_COMPILE`
83+
- Use custom function mode `get_default_mode().excluding("fusion")` or skip tests in `FAST_COMPILE` if they are not directly relevant to the mode.
7884

7985
Alternative backends (JAX, NUMBA, ...) are optional. Use `pytest.importorskip` to fail gracefully.
8086

0 commit comments

Comments
 (0)