Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions infini_train/src/autograd/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Scatter::Scatter(const std::vector<Device> &target_gpus, int64_t dim,
std::vector<std::shared_ptr<Tensor>> Scatter::Forward(const std::vector<std::shared_ptr<Tensor>> &input_tensors) {
const auto &input = input_tensors[0];
std::vector<std::shared_ptr<Tensor>> output_tensors;
auto device = input->GetDevice().type();
output_tensors = pg_->Scatter(input, target_gpus_, dim_);
return output_tensors;
}
Expand Down Expand Up @@ -51,7 +50,7 @@ std::vector<std::shared_ptr<Tensor>> Gather::Forward(const std::vector<std::shar
} else {
unsqueezed_scalar_ = false;
}
auto device = input_tensors[0]->GetDevice().type();

return {pg_->Gather(input_tensors, target_device_, dim_)};
}

Expand Down
1 change: 0 additions & 1 deletion infini_train/src/kernels/cpu/linear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ std::shared_ptr<Tensor> LinearForward(const std::shared_ptr<Tensor> &input, cons

const auto &input_dims = input->Dims();
CHECK_GE(input_dims.size(), 2);
const int64_t bs = std::accumulate(input_dims.rbegin() + 1, input_dims.rend(), 1, std::multiplies<int64_t>{});
const int64_t in_features = *input_dims.rbegin();

const auto &weight_dims = weight->Dims();
Expand Down
1 change: 0 additions & 1 deletion infini_train/src/kernels/cpu/reduction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ std::shared_ptr<Tensor> ReduceOpForward(const std::shared_ptr<Tensor> &input, co
CHECK_LT(actual_dim, input_dims.size());

std::vector<int64_t> output_dims = input_dims;
const int64_t reduce_size = input_dims[dim];
if (keep_dim) {
output_dims[actual_dim] = 1;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ CausalSelfAttention::ForwardStandard(const std::vector<std::shared_ptr<infini_tr
auto tp_world_size = parallel::global::GetTensorParallelSize();

const auto B = x[0]->Dims()[0]; // bs
const auto C = x[0]->Dims()[2]; // n_embd
const int64_t head_dim = n_embd_ / n_head_; // per-head dim (global)
const int64_t local_C = n_embd_ / tp_world_size; // per-rank hidden

Expand Down
1 change: 0 additions & 1 deletion infini_train/src/nn/modules/transformer/mlp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ MLP::MLP(const TransformerConfig &config) : CloneableModule(kType) {
}

// Round up to multiple_of
int64_t before_round = ffn_hidden;
ffn_hidden = (ffn_hidden + config.multiple_of - 1) / config.multiple_of * config.multiple_of;

// c_fc: ColumnParallel (input full, output parallel)
Expand Down
1 change: 0 additions & 1 deletion infini_train/src/nn/parallel/ddp/reducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ void Reducer::MarkBucketReady(size_t bucket_index) {
}
// From next_bucket_, launch ready buckets(pending==0) in turn
while (next_bucket_ < buckets_.size() && buckets_[next_bucket_].pending == 0) {
auto &bucket = buckets_[next_bucket_];
FinalizeBucketDense(next_bucket_);
++next_bucket_;
}
Expand Down
1 change: 0 additions & 1 deletion infini_train/src/nn/parallel/tensor_parallel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ VocabParallelCrossEntropy::Forward(const std::vector<std::shared_ptr<Tensor>> &i
auto logits = std::make_shared<Tensor>(input_tensors[0]->To(DataType::kFLOAT32));
auto target = input_tensors[1];

auto dtype = logits->Dtype();
auto device = logits->GetDevice();

CHECK(target->Dtype() == DataType::kINT64) << "target must be int64";
Expand Down
1 change: 0 additions & 1 deletion infini_train/src/tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ void Tensor::Print(std::ostream &os) const {
CHECK(dtype_ == DataType::kFLOAT32);

const size_t num_elements = NumElements();
const size_t num_bytes = num_elements * sizeof(float);

auto impl = core::GetDeviceGuardImpl(GetDevice().type());

Expand Down
Loading