Skip to content

Commit

Permalink
Using cudaMemcpyAsync now, removed unused code. Working for non-fused…
Browse files Browse the repository at this point in the history
… setting
  • Loading branch information
yingchen21 committed Aug 7, 2024
1 parent f1444e9 commit 30b3fae
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 273 deletions.
6 changes: 0 additions & 6 deletions include/flexflow/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,17 @@ class Op {

// save all inputs
for (int i = 0; i < input_tensors.size(); i++) {
std::cout<<"input tensor "<<i<<": "<<input_tensors[i].domain.lo()<<" "<<input_tensors[i].domain.hi()<<std::endl;
std::string filename = dst_filepath.string() + ".input_";
if (fwd_pass) {
filename += std::to_string(i);
} else {
filename += "gradient_" + std::to_string(i);
}
if (input_tensors[i].data_type == DT_FLOAT) {
std::cout<<"saving tensor as float"<<std::endl;
save_tensor(input_tensors[i].get_float_ptr(),
input_tensors[i].domain.get_volume(),
filename.c_str());
} else if (input_tensors[i].data_type == DT_HALF) {
std::cout<<"saving tensor as half"<<std::endl;
save_tensor(input_tensors[i].get_half_ptr(),
input_tensors[i].domain.get_volume(),
filename.c_str());
Expand Down Expand Up @@ -365,20 +362,17 @@ class Op {

// save all outputs
for (int i = 0; i < output_tensors.size(); i++) {
std::cout<<"output tensor "<<i<<": "<<output_tensors[i].domain.lo()<<" "<<output_tensors[i].domain.hi()<<std::endl;
std::string filename = dst_filepath.string() + ".output_";
if (fwd_pass) {
filename += std::to_string(i);
} else {
filename += "gradient_" + std::to_string(i);
}
if (output_tensors[i].data_type == DT_FLOAT) {
std::cout<<"saving tensor as float"<<std::endl;
save_tensor(output_tensors[i].get_float_ptr(),
output_tensors[i].domain.get_volume(),
filename.c_str());
} else if (output_tensors[i].data_type == DT_HALF) {
std::cout<<"saving tensor as half"<<std::endl;
save_tensor(output_tensors[i].get_half_ptr(),
output_tensors[i].domain.get_volume(),
filename.c_str());
Expand Down
5 changes: 1 addition & 4 deletions include/flexflow/ops/inc_multihead_self_attention.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ class IncMultiHeadSelfAttention : public Op {
BatchConfig const *bc,
int shard_id,
GenericTensorAccessorR const &input,
// GenericTensorAccessorR const &weight,
GenericTensorAccessorW const &output
// GenericTensorAccessorR const &bias);
);
GenericTensorAccessorW const &output);
static void peft_bwd_kernel_wrapper(IncMultiHeadSelfAttentionMeta *m,
BatchConfig const *bc,
int shard_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ template <typename DT>
void compute_qkv_kernel(IncMultiHeadSelfAttentionMeta const *m,
BatchConfig const *bc,
int shard_id,
// DT const *weight_ptr,
DT *output_ptr,
// DT const *bias_ptr,
ffStream_t stream);

template <typename DT>
Expand Down
Loading

0 comments on commit 30b3fae

Please sign in to comment.