summaryrefslogtreecommitdiff
path: root/candle-pyo3/py_src
Commit message (Collapse)AuthorAgeFilesLines
* pyo3 update. (#2545)Laurent Mazare2024-10-061-7/+3
| | | | | * pyo3 update. * Stub fix.
* Update for pyo3 0.21. (#1985)Laurent Mazare2024-04-011-0/+19
| | | | | | | | | | | * Update for pyo3 0.21. * Also adapt the RL example. * Fix for the pyo3-onnx bindings... * Print details on failures. * Revert pyi.
* Expose candle gather op in pyo3. (#1870)Laurent Mazare2024-03-181-0/+6
|
* Detach the tensors on batch-norm eval. (#1702)Laurent Mazare2024-02-135-12/+88
| | | | | | | | | | | | | * Detach the tensors on batch-norm eval. * Fix pyo3 bindings. * Black tweak. * Formatting. * Also update the pyo3-onnx formatting. * Apply black.
* Quantized GGUF style (#1523)Nicolas Patry2024-01-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Metal quantized modifications proposal. - Add a device param, wherever needed. - Create new QMetal storage thing that implements QuantizedType. - Update everywhere needed. Fix Python. Fixing examples. Fix: fmt + clippy + stub. Moving everything around. Only missing the actual implems. Fixing everything + adding dequantized kernels. More work. Fixing matmul. Fmt + Clippy Some clippy fixes. Working state. Q2K Metal -> Bugged (also present in GGML). Q4K CPU -> Bugged (present previously, new test catch it). Q5K CPU -> Bugged (present previously). Q8_1 Both -> Never really implemented it seems Q8K metal -> Never implemented in metal Fixing Q2K bug (present in ggml). * Cleanup. * Fix the rebase. * Removing the fences speeds everything up and *is* correct this time... * Cleanup the fence. * After rebase. * Bad code removal. * Rebase after phi2 merge + fix replit default to CPU. * Making the CI happy. * More happy tests. --------- Co-authored-by: Nicolas Patry <nicolas@Nicolass-MacBook-Pro.local>
* Fix a couple typos (#1451)Laurent Mazare2023-12-172-3/+4
| | | | | * Mixtral quantized instruct. * Fix a couple typos.
* PyO3: Add optional `candle.onnx` module (#1282)Lukas Kreussel2023-11-082-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Start onnx integration * Merge remote-tracking branch 'upstream/main' into feat/pyo3-onnx * Implement ONNXModel * `fmt` * add `onnx` flag to python ci * Pin `protoc` to `25.0` * Setup `protoc` in wheel builds * Build wheels with `onnx` * Install `protoc` in manylinux containers * `apt` -> `yum` * Download `protoc` via bash script * Back to `manylinux: auto` * Disable `onnx` builds for linux
* PyO3: Add `equal` and `__richcmp__` to `candle.Tensor` (#1099)Lukas Kreussel2023-10-302-0/+111
| | | | | | | | | | | | | | | | | | | * add `equal` to tensor * add `__richcmp__` support for tensors and scalars * typo * more typos * Add `abs` + `candle.testing` * remove duplicated `broadcast_shape_binary_op` * `candle.i16` => `candle.i64` * `tensor.nelements` -> `tensor.nelement` * Cleanup `abs`
* PyO3: Better shape handling (#1143)Lukas Kreussel2023-10-294-10/+12
| | | | | | | | | | | * Negative and `*args` shape handling * Rename to `PyShapeWithHole` + validate that only one hole exists * Regenerate stubs --------- Co-authored-by: Laurent Mazare <laurent.mazare@gmail.com>
* convert pytorch's tensor in Python API (#1172)andrew2023-10-251-0/+5
| | | | | * convert pytorch's tensor * separate tests for convert pytorch tensor
* PyO3: Add `mkl` support (#1159)Lukas Kreussel2023-10-231-12/+36
| | | | | * Add `mkl` support * Set `mkl` path on linux
* PyO3: Add CI (#1135)Lukas Kreussel2023-10-201-3/+4
| | | | | | | * Add PyO3 ci * Update python.yml * Format `bert.py`
* PyO3: Add pytorch like `.to()` operator to `candle.Tensor` (#1100)Lukas Kreussel2023-10-191-0/+5
| | | | | * add `.to()` operator * Only allow each value to be provided once via `args` or `kwargs`
* Extend `stub.py` to accept external typehinting (#1102)Lukas Kreussel2023-10-174-3/+47
|
* Add the pooling operators to the pyo3 layer. (#1086)Laurent Mazare2023-10-132-0/+16
|
* Use an attention mask in the e5 padding case. (#1085)Laurent Mazare2023-10-131-10/+24
|
* Make the Python Wrapper more Hackable and simplify Quantization (#1010)Lukas Kreussel2023-10-0612-11/+1806
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Some first `Module` implementations * Add `state_dict` and `load_state_dict` functionality * Move modules around and create `candle.nn.Linear` * Add `nn.Embedding` and `nn.LayerNorm` * Add BERT implementation * Batch q-matmul * Automatically dequantize `QTensors` if a `Tensor` is expected * Add Module `.to()`, `.cuda()`, `cpu()` and `.type()` functionality * Unittests for `Module`, `Tensor` and `candle.utils` * Add `pytorch` like slicing to `Tensor` * Cleanup and BERT fixes * `black` formatting + unit-test for `nn.Linear` * Refactor slicing implementation
* Add return types to `*.pyi` stubs (#880)Lukas Kreussel2023-09-175-131/+270
| | | | | | | | | * Start generating return types * Finish tensor type hinting * Add `save_gguf` to `utils` * Typehint `quant-llama.py`
* Generate `*.pyi` stubs for PyO3 wrapper (#870)Lukas Kreussel2023-09-167-0/+363
* Begin to generate typehints. * generate correct stubs * Correctly include stubs * Add comments and typhints to static functions * ensure candle-pyo3 directory * Make `llama.rope.freq_base` optional * `fmt`