Skip to content

Commit

Permalink
Merge branch 'chhwang/minor-updates' into chhwang/llama
Browse files Browse the repository at this point in the history
  • Loading branch information
chhwang committed Sep 18, 2023
2 parents 7c29085 + 41b7ac2 commit 04c3145
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion ark/gpu/gpu_compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sys/wait.h>
#include <unistd.h>

#include "cpu_timer.h"
#include "env.h"
#include "gpu/gpu_compile.h"
#include "gpu/gpu_logging.h"
Expand Down Expand Up @@ -218,7 +219,8 @@ const string gpu_compile(const vector<string> &codes,
"-o " << item.second << ".cubin "
<< cu_file_path << " 2>&1";
// clang-format on
LOG(INFO, "Compiling ", cu_file_path);
double start = cpu_timer();
LOG(INFO, "Compiling: ", cu_file_path);
LOG(DEBUG, exec_cmd.str());
// Run the command.
array<char, 4096> buffer;
Expand All @@ -235,6 +237,8 @@ const string gpu_compile(const vector<string> &codes,
if (exec_print_str.size() > 0) {
LOG(ERROR, endl, exec_print_str, endl);
}
LOG(INFO, "Compile succeed: ", cu_file_path, " (",
cpu_timer() - start, " seconds)");
});
string cu_file_path = items[0].second + ".cu";
string cubin_file_path = items[0].second + ".cubin";
Expand Down
1 change: 1 addition & 0 deletions ark/gpu/gpu_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ void GpuMgrCtx::freeze()

//
if (total_bytes > 0) {
LOG(INFO, "Allocating ", total_bytes, " bytes of GPU memory");
this->data_mem.init(total_bytes);
// init the data mem
CULOG(cuMemsetD32(this->data_mem.ref(), 0, total_bytes >> 2));
Expand Down
2 changes: 1 addition & 1 deletion ark/ops/ops_layernorm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern const OpConfigMap LayernormConfigMap;
LayernormOp::LayernormOp(OpPrecType prec_type, Tensor *input, Tensor *output,
const std::string &name)
: Op{OP_LAYERNORM, prec_type, {input}, {output}, {},
name, &LayernormConfigMap, -1}
name, &LayernormConfigMap, -1, true}
{
}

Expand Down
2 changes: 1 addition & 1 deletion ark/ops/ops_rmsnorm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern const OpConfigMap LayernormConfigMap;
RMSnormOp::RMSnormOp(OpPrecType prec_type, Tensor *input, Tensor *output,
const std::string &name)
: Op{OP_RMSNORM, prec_type, {input}, {output}, {},
name, &LayernormConfigMap, -1}
name, &LayernormConfigMap, -1, true}
{
}

Expand Down
6 changes: 4 additions & 2 deletions ark/ops/ops_sendrecv_mm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ SendMMOp::SendMMOp(OpPrecType prec_type, Tensor *input, Tensor *recvbuf,
{{id, gpu_dst, bytes}},
name,
&SendRecvMMConfigMap,
-1}
-1,
true}
{
}

Expand Down Expand Up @@ -81,7 +82,8 @@ RecvMMOp::RecvMMOp(OpPrecType prec_type, Tensor *input, Tensor *recvbuf,
{{id, gpu_src, bytes}},
name,
&SendRecvMMConfigMap,
-1}
-1,
true}
{
}

Expand Down
4 changes: 2 additions & 2 deletions ark/ops/ops_softmax.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extern const OpConfigMap SoftmaxConfigMap;

SoftmaxOp::SoftmaxOp(OpPrecType prec_type, Tensor *input, Tensor *output,
const std::string &name)
: Op{OP_SOFTMAX, prec_type, {input}, {output},
{}, name, &SoftmaxConfigMap, -1}
: Op{OP_SOFTMAX, prec_type, {input}, {output}, {},
name, &SoftmaxConfigMap, -1, true}
{
}

Expand Down
2 changes: 1 addition & 1 deletion ark/ops/ops_transpose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extern const OpConfigMap TransposeConfigMap;
TransposeOp::TransposeOp(OpPrecType prec_type, Tensor *input, Tensor *output,
int tp_type, const std::string &name)
: Op{OP_TRANSPOSE, prec_type, {input}, {output}, {{tp_type}},
name, &TransposeConfigMap, -1}
name, &TransposeConfigMap, -1, true}
{
}

Expand Down

0 comments on commit 04c3145

Please sign in to comment.