Instructions to use replicate/quantization-eetq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/quantization-eetq with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/quantization-eetq", version=1) - Notebooks
- Google Colab
- Kaggle
Download utils/torch_utils.h from replicate/quantization-eetq: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/replicate/quantization-eetq/resolve/8f7b5f05c1eef6061e33b4e67ce888eb3e558e44/utils/torch_utils.h
- Command line
-
hf download hf://replicate/quantization-eetq@8f7b5f05c1eef6061e33b4e67ce888eb3e558e44/utils/torch_utils.h
-
curl -L -o torch_utils.h https://huggingface.co/replicate/quantization-eetq/resolve/8f7b5f05c1eef6061e33b4e67ce888eb3e558e44/utils/torch_utils.h
3.52 kB
| // Generates a conflict with CUDA 12.6 between nvtx 2 and 3. Does not | |
| // seem to be used anyway? | |
| // | |
| // #include <nvToolsExt.h> | |
| namespace fastertransformer { | |
| template<typename T> | |
| inline T* get_ptr(torch::Tensor& t) | |
| { | |
| return reinterpret_cast<T*>(t.data_ptr()); | |
| } | |
| std::vector<size_t> convert_shape(torch::Tensor tensor); | |
| size_t sizeBytes(torch::Tensor tensor); | |
| QuantType get_ft_quant_type(torch::ScalarType quant_type) | |
| { | |
| if (quant_type == torch::kInt8) { | |
| return QuantType::INT8_WEIGHT_ONLY; | |
| } | |
| else if (quant_type == at::ScalarType::QUInt4x2) { | |
| return QuantType::PACKED_INT4_WEIGHT_ONLY; | |
| } | |
| else { | |
| TORCH_CHECK(false, "Invalid quantization type"); | |
| } | |
| } | |
| } // namespace fastertransformer | |