Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
9946165e
Unverified
Commit
9946165e
authored
Feb 16, 2024
by
OlivierDehaene
Committed by
GitHub
Feb 16, 2024
Browse files
chore: add pre-commit (#1569)
parent
142cdabe
Changes
78
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
34 additions
and
36 deletions
+34
-36
server/Makefile-flash-att
server/Makefile-flash-att
+1
-1
server/Makefile-selective-scan
server/Makefile-selective-scan
+3
-3
server/README.md
server/README.md
+1
-1
server/custom_kernels/custom_kernels/fused_bloom_attention_cuda.cu
...stom_kernels/custom_kernels/fused_bloom_attention_cuda.cu
+1
-1
server/exllama_kernels/exllama_kernels/cuda_func/column_remap.cuh
...xllama_kernels/exllama_kernels/cuda_func/column_remap.cuh
+1
-1
server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cuh
...r/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cuh
+1
-1
server/exllama_kernels/exllama_kernels/hip_compat.cuh
server/exllama_kernels/exllama_kernels/hip_compat.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/matrix_view.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/matrix_view.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm.cuh
server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_6.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_6.cuh
+0
-2
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_8.cuh
.../exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_8.cuh
+1
-1
server/exllamav2_kernels/exllamav2_kernels/cuda/util.cuh
server/exllamav2_kernels/exllamav2_kernels/cuda/util.cuh
+1
-1
server/text_generation_server/models/custom_modeling/flash_llama_modeling.py
...ion_server/models/custom_modeling/flash_llama_modeling.py
+3
-3
server/text_generation_server/models/custom_modeling/flash_mistral_modeling.py
...n_server/models/custom_modeling/flash_mistral_modeling.py
+3
-3
server/text_generation_server/models/custom_modeling/flash_mixtral_modeling.py
...n_server/models/custom_modeling/flash_mixtral_modeling.py
+6
-6
server/text_generation_server/models/custom_modeling/flash_neox_modeling.py
...tion_server/models/custom_modeling/flash_neox_modeling.py
+3
-3
server/text_generation_server/models/custom_modeling/flash_phi_modeling.py
...ation_server/models/custom_modeling/flash_phi_modeling.py
+3
-3
No files found.
server/Makefile-flash-att
View file @
9946165e
...
@@ -13,4 +13,4 @@ build-flash-attention: flash-attention
...
@@ -13,4 +13,4 @@ build-flash-attention: flash-attention
install-flash-attention: build-flash-attention
install-flash-attention: build-flash-attention
pip uninstall flash_attn rotary_emb dropout_layer_norm -y || true
pip uninstall flash_attn rotary_emb dropout_layer_norm -y || true
cd flash-attention && python setup.py install && cd csrc/layer_norm && python setup.py install && cd ../rotary && python setup.py install
cd flash-attention && python setup.py install && cd csrc/layer_norm && python setup.py install && cd ../rotary && python setup.py install
\ No newline at end of file
server/Makefile-selective-scan
View file @
9946165e
...
@@ -13,7 +13,7 @@ install-causal-conv1d: build-causal-conv1d
...
@@ -13,7 +13,7 @@ install-causal-conv1d: build-causal-conv1d
cd causal-conv1d/ && pip install .
cd causal-conv1d/ && pip install .
# selective-scan dependends on causal-conv1d
# selective-scan dependends on causal-conv1d
selective-scan:
selective-scan:
rm -rf mamba
rm -rf mamba
git clone https://github.com/state-spaces/mamba.git mamba
git clone https://github.com/state-spaces/mamba.git mamba
...
@@ -21,8 +21,8 @@ build-selective-scan: selective-scan
...
@@ -21,8 +21,8 @@ build-selective-scan: selective-scan
cd mamba/ && git fetch && git checkout $(selective_scan_commit)
cd mamba/ && git fetch && git checkout $(selective_scan_commit)
cd mamba && python setup.py build
cd mamba && python setup.py build
install-selective-scan: install-causal-conv1d build-selective-scan
install-selective-scan: install-causal-conv1d build-selective-scan
pip uninstall selective-scan-cuda -y || true
pip uninstall selective-scan-cuda -y || true
cd mamba && pip install .
cd mamba && pip install .
build-all: build-causal-conv1d build-selective-scan
build-all: build-causal-conv1d build-selective-scan
\ No newline at end of file
server/README.md
View file @
9946165e
...
@@ -12,4 +12,4 @@ make install
...
@@ -12,4 +12,4 @@ make install
```
shell
```
shell
make run-dev
make run-dev
```
```
\ No newline at end of file
server/custom_kernels/custom_kernels/fused_bloom_attention_cuda.cu
View file @
9946165e
...
@@ -247,4 +247,4 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
...
@@ -247,4 +247,4 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
&
forward
,
&
forward
,
"Bloom attention mechanism forward (CUDA)"
"Bloom attention mechanism forward (CUDA)"
);
);
}
}
\ No newline at end of file
server/exllama_kernels/exllama_kernels/cuda_func/column_remap.cuh
View file @
9946165e
...
@@ -16,4 +16,4 @@ void column_remap_cuda
...
@@ -16,4 +16,4 @@ void column_remap_cuda
const
uint32_t
*
x_map
const
uint32_t
*
x_map
);
);
#endif
#endif
\ No newline at end of file
server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cuh
View file @
9946165e
...
@@ -50,4 +50,4 @@ private:
...
@@ -50,4 +50,4 @@ private:
void
g_q4_keep_matrix
(
Q4Matrix
*
m
);
void
g_q4_keep_matrix
(
Q4Matrix
*
m
);
void
g_q4_free_matrices
();
void
g_q4_free_matrices
();
#endif
#endif
\ No newline at end of file
server/exllama_kernels/exllama_kernels/hip_compat.cuh
View file @
9946165e
...
@@ -48,4 +48,4 @@ __host__ __forceinline__ hipblasStatus_t __compat_hipblasHgemm(hipblasHandle_t
...
@@ -48,4 +48,4 @@ __host__ __forceinline__ hipblasStatus_t __compat_hipblasHgemm(hipblasHandle_t
#define rocblas_set_stream hipblasSetStream
#define rocblas_set_stream hipblasSetStream
#define rocblas_hgemm __compat_hipblasHgemm
#define rocblas_hgemm __compat_hipblasHgemm
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/matrix_view.cuh
View file @
9946165e
...
@@ -118,4 +118,4 @@ public:
...
@@ -118,4 +118,4 @@ public:
}
}
};
};
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm.cuh
View file @
9946165e
...
@@ -33,4 +33,4 @@ void clear_tensor_cuda
...
@@ -33,4 +33,4 @@ void clear_tensor_cuda
int
size_n
int
size_n
);
);
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh
View file @
9946165e
...
@@ -100,4 +100,4 @@ __forceinline__ __device__ void dequant_2bit_16
...
@@ -100,4 +100,4 @@ __forceinline__ __device__ void dequant_2bit_16
#endif
#endif
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh
View file @
9946165e
...
@@ -224,4 +224,4 @@ __forceinline__ __device__ void dequant_4bit_8_gptq
...
@@ -224,4 +224,4 @@ __forceinline__ __device__ void dequant_4bit_8_gptq
#endif
#endif
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_5.cuh
View file @
9946165e
...
@@ -204,4 +204,4 @@ __forceinline__ __device__ void dequant_5bit_32
...
@@ -204,4 +204,4 @@ __forceinline__ __device__ void dequant_5bit_32
#endif
#endif
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_6.cuh
View file @
9946165e
...
@@ -40,5 +40,3 @@ __forceinline__ __device__ void dequant_6bit_16
...
@@ -40,5 +40,3 @@ __forceinline__ __device__ void dequant_6bit_16
#endif
#endif
#endif
#endif
server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_8.cuh
View file @
9946165e
...
@@ -35,4 +35,4 @@ __forceinline__ __device__ void dequant_8bit_8
...
@@ -35,4 +35,4 @@ __forceinline__ __device__ void dequant_8bit_8
#endif
#endif
#endif
#endif
\ No newline at end of file
server/exllamav2_kernels/exllamav2_kernels/cuda/util.cuh
View file @
9946165e
...
@@ -51,4 +51,4 @@ inline void gpu_assert(cudaError_t code, const char *file, int line, bool abort=
...
@@ -51,4 +51,4 @@ inline void gpu_assert(cudaError_t code, const char *file, int line, bool abort=
void
print_global_mem
(
const
half
*
ptr
,
int
rows
,
int
columns
,
int
stride
);
void
print_global_mem
(
const
half
*
ptr
,
int
rows
,
int
columns
,
int
stride
);
#endif
#endif
\ No newline at end of file
server/text_generation_server/models/custom_modeling/flash_llama_modeling.py
View file @
9946165e
...
@@ -251,9 +251,9 @@ class LlamaMLP(nn.Module):
...
@@ -251,9 +251,9 @@ class LlamaMLP(nn.Module):
if
"gelu"
not
in
act
if
"gelu"
not
in
act
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
)
)
# Fuse gate and up proj
# Fuse gate and up proj
...
...
server/text_generation_server/models/custom_modeling/flash_mistral_modeling.py
View file @
9946165e
...
@@ -255,9 +255,9 @@ class MistralMLP(nn.Module):
...
@@ -255,9 +255,9 @@ class MistralMLP(nn.Module):
if
"gelu"
not
in
act
if
"gelu"
not
in
act
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
)
)
# Fuse gate and up proj
# Fuse gate and up proj
...
...
server/text_generation_server/models/custom_modeling/flash_mixtral_modeling.py
View file @
9946165e
...
@@ -344,9 +344,9 @@ class BlockSparseMoE(nn.Module):
...
@@ -344,9 +344,9 @@ class BlockSparseMoE(nn.Module):
if
"gelu"
in
act
:
if
"gelu"
in
act
:
self
.
act
=
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
self
.
act
=
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
elif
"silu"
in
act
:
elif
"silu"
in
act
:
self
.
act
=
torch
.
nn
.
functional
.
silu
self
.
act
=
torch
.
nn
.
functional
.
silu
...
@@ -600,9 +600,9 @@ class DenseMoE(nn.Module):
...
@@ -600,9 +600,9 @@ class DenseMoE(nn.Module):
if
"gelu"
in
act
:
if
"gelu"
in
act
:
self
.
act
=
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
self
.
act
=
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
elif
"silu"
in
act
:
elif
"silu"
in
act
:
self
.
act
=
torch
.
nn
.
functional
.
silu
self
.
act
=
torch
.
nn
.
functional
.
silu
...
...
server/text_generation_server/models/custom_modeling/flash_neox_modeling.py
View file @
9946165e
...
@@ -187,9 +187,9 @@ class FlashMLP(nn.Module):
...
@@ -187,9 +187,9 @@ class FlashMLP(nn.Module):
if
"gelu"
not
in
act
if
"gelu"
not
in
act
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
)
)
...
...
server/text_generation_server/models/custom_modeling/flash_phi_modeling.py
View file @
9946165e
...
@@ -225,9 +225,9 @@ class PhiMLP(nn.Module):
...
@@ -225,9 +225,9 @@ class PhiMLP(nn.Module):
if
"gelu"
not
in
act
if
"gelu"
not
in
act
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
else
lambda
x
:
torch
.
nn
.
functional
.
gelu
(
x
,
x
,
approximate
=
"tanh"
approximate
=
(
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
"tanh"
if
act
in
[
"gelu_fast"
,
"gelu_pytorch_tanh"
]
else
"none"
else
"none"
,
)
,
)
)
)
)
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment