Skip to content

Commit

Permalink
[XPU] Add docs for gm_default_size and fix type (#1962)
Browse files Browse the repository at this point in the history
Add description of gm_default_size and change kunlunxin_gm_default_size‘s type to int64_t
  • Loading branch information
linkk08 authored May 18, 2023
1 parent 04ef882 commit c8ff8b6
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion c_api/fastdeploy_capi/runtime/runtime_option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void FD_C_RuntimeOptionWrapperUseKunlunXin(
std::string(precision),
bool(adaptive_seqlen),
bool(enable_multi_stream),
gm_default_size);
int64_t(gm_default_size));
}

void FD_C_RuntimeOptionWrapperUseSophgo(
Expand Down
1 change: 1 addition & 0 deletions c_api/fastdeploy_capi/runtime/runtime_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ FASTDEPLOY_CAPI_EXPORT extern void FD_C_RuntimeOptionWrapperUseAscend(
/// \param[in] adaptive_seqlen Is the input of multi_encoder variable length
/// \param[in] enable_multi_stream Whether to enable the multi stream of
/// KunlunXin XPU.
/// \param[in] gm_default_size The default size of context global memory of KunlunXin XPU.
///
FASTDEPLOY_CAPI_EXPORT extern void FD_C_RuntimeOptionWrapperUseKunlunXin(
__fd_keep FD_C_RuntimeOptionWrapper* fd_c_runtime_option_wrapper,
Expand Down
1 change: 1 addition & 0 deletions csharp/fastdeploy/runtime_option.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void UseAscend() {
/// \param adaptive_seqlen Is the input of multi_encoder variable length
/// \param enable_multi_stream Whether to enable the multi stream of
/// KunlunXin XPU.
/// \param gm_default_size The default size of context global memory of KunlunXin XPU.
///
public void
UseKunlunXin(int kunlunxin_id = 0, int l3_workspace_size = 0xfffc00,
Expand Down
4 changes: 2 additions & 2 deletions fastdeploy/runtime/backends/lite/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ struct LiteBackendOption {
std::string kunlunxin_autotune_file = "";
/// kunlunxin_precision
std::string kunlunxin_precision = "int16";
/// kunlunxin_gm_default_size
int kunlunxin_gm_default_size = 0;
/// kunlunxin_adaptive_seqlen
bool kunlunxin_adaptive_seqlen = false;
/// kunlunxin_enable_multi_stream
bool kunlunxin_enable_multi_stream = false;
/// kunlunxin_gm_default_size
int64_t kunlunxin_gm_default_size = 0;

/// Optimized model dir for CxxConfig
std::string optimized_model_dir = "";
Expand Down
1 change: 1 addition & 0 deletions fastdeploy/runtime/runtime_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct FASTDEPLOY_DECL RuntimeOption {
/// \param adaptive_seqlen Is the input of multi_encoder variable length
/// \param enable_multi_stream Whether to enable the multi stream of
/// KunlunXin XPU.
/// \param gm_default_size The default size of global memory of KunlunXin XPU.
///
void UseKunlunXin(int kunlunxin_id = 0, int l3_workspace_size = 0xfffc00,
bool locked = false, bool autotune = true,
Expand Down
1 change: 1 addition & 0 deletions python/fastdeploy/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def use_kunlunxin(self,
:param precision: (str)Calculation accuracy of multi_encoder
:param adaptive_seqlen: (bool)adaptive_seqlen Is the input of multi_encoder variable length
:param enable_multi_stream: (bool)Whether to enable the multi stream of KunlunXin XPU.
:param gm_default_size The default size of context global memory of KunlunXin XPU.
"""
return self._option.use_kunlunxin(device_id, l3_workspace_size, locked,
autotune, autotune_file, precision,
Expand Down

0 comments on commit c8ff8b6

Please sign in to comment.