Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
reyna-abhyankar committed Aug 27, 2024
1 parent 1ddfade commit dde9496
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions lib/local-execution/test/src/test_update_e2e.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,75 +48,74 @@ TEST_SUITE(FF_CUDA_TEST_SUITE) {

SUBCASE("SGDOptimizerAttrs") {
SUBCASE("momentum=0") {
OptimizerAttrs optimizer_attrs = OptimizerAttrs{SGDOptimizerAttrs{
/*lr=*/0.001,
/*momentum=*/0.0f,
/*nesterov=*/false,
/*weight_decay=*/0.001
}};
OptimizerAttrs optimizer_attrs =
OptimizerAttrs{SGDOptimizerAttrs{/*lr=*/0.001,
/*momentum=*/0.0f,

Check warning on line 53 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L49-L53

Added lines #L49 - L53 were not covered by tests
/*nesterov=*/false,
/*weight_decay=*/0.001}};
std::optional<ModelTrainingInstance> model_training_instance =
ModelTrainingInstance{
LossAttrs{OtherLossAttrs{
LossFunction::MEAN_SQUARED_ERROR_AVG_REDUCE}},

Check warning on line 59 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L55-L59

Added lines #L55 - L59 were not covered by tests
label_tensor,
logit_tensor, optimizer_attrs};
logit_tensor,
optimizer_attrs};
LocalTrainingBacking local_backing(allocator,

Check warning on line 63 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L62-L63

Added lines #L62 - L63 were not covered by tests
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
local_backing.execute_init();
local_backing.execute_forward();
local_backing.execute_backward();
local_backing.execute_update();
}
SUBCASE("momentum=0.9") {
OptimizerAttrs optimizer_attrs = OptimizerAttrs{SGDOptimizerAttrs{
/*lr=*/0.001,
/*momentum=*/0.9,
/*nesterov=*/false,
/*weight_decay=*/0.001
}};
OptimizerAttrs optimizer_attrs =
OptimizerAttrs{SGDOptimizerAttrs{/*lr=*/0.001,
/*momentum=*/0.9,

Check warning on line 76 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L67-L76

Added lines #L67 - L76 were not covered by tests
/*nesterov=*/false,
/*weight_decay=*/0.001}};
std::optional<ModelTrainingInstance> model_training_instance =
ModelTrainingInstance{
LossAttrs{OtherLossAttrs{
LossFunction::MEAN_SQUARED_ERROR_AVG_REDUCE}},

Check warning on line 82 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L78-L82

Added lines #L78 - L82 were not covered by tests
label_tensor,
logit_tensor, optimizer_attrs};
logit_tensor,
optimizer_attrs};
LocalTrainingBacking local_backing(allocator,

Check warning on line 86 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L85-L86

Added lines #L85 - L86 were not covered by tests
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
local_backing.execute_init();
local_backing.execute_forward();
local_backing.execute_backward();
local_backing.execute_update();
}
}
SUBCASE("AdamOptimizerAttrs") {
OptimizerAttrs optimizer_attrs = OptimizerAttrs{AdamOptimizerAttrs{
/*alpha=*/ 0.001,
/*beta1=*/ 0.9,
/*beta2=*/ 0.999,
/*weight_decay=*/ 0.001,
/*alpha_t=*/ 0.001,
/*beta_t=*/ 0.9,
/*beta2_t=*/ 0.999,
/*epsilon=*/ 1e-8
}
};
OptimizerAttrs optimizer_attrs =
OptimizerAttrs{AdamOptimizerAttrs{/*alpha=*/0.001,
/*beta1=*/0.9,
/*beta2=*/0.999,
/*weight_decay=*/0.001,
/*alpha_t=*/0.001,
/*beta_t=*/0.9,
/*beta2_t=*/0.999,
/*epsilon=*/1e-8}};
std::optional<ModelTrainingInstance> model_training_instance =
ModelTrainingInstance{
LossAttrs{OtherLossAttrs{
LossFunction::MEAN_SQUARED_ERROR_AVG_REDUCE}},
LossAttrs{
OtherLossAttrs{LossFunction::MEAN_SQUARED_ERROR_AVG_REDUCE}},

Check warning on line 110 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L90-L110

Added lines #L90 - L110 were not covered by tests
label_tensor,
logit_tensor, optimizer_attrs};
logit_tensor,
optimizer_attrs};
LocalTrainingBacking local_backing(allocator,

Check warning on line 114 in lib/local-execution/test/src/test_update_e2e.cc

View check run for this annotation

Codecov / codecov/patch

lib/local-execution/test/src/test_update_e2e.cc#L113-L114

Added lines #L113 - L114 were not covered by tests
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
cg_builder.computation_graph,
tensor_backing_map,
runtime_arg_config,
model_training_instance);
local_backing.execute_init();
local_backing.execute_forward();
local_backing.execute_backward();
Expand Down

0 comments on commit dde9496

Please sign in to comment.