Skip to content

Commit

Permalink
fix: Gtest fix (#4657)
Browse files Browse the repository at this point in the history
* test

* rm

* upgrade googletest

* ts

* Update VowpalWabbitUtils.cmake

* libc++

* only for clang

* install clang builds

* revert

* remove clang

* try just 20

* try v4

* clang 15

* rm 20

* include

* ignore unused for eigen

* lint

* only for clang/gnu

* ignore eigen unused

* get target

* vw

* only for gf test

* fix

* check test target built

* try def clang

* update apt-get

* libc++ for clang

* clang15 for ubuntu 22

* spell out matrix

* check g++ ve3rsion

* ep_dec fix

* lint

* try 17 std

* rm named_labels include

* readd include

* revert settings.json
  • Loading branch information
bassmang authored Nov 1, 2023
1 parent 4734d3f commit a541d85
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vendor_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
-DVW_INSTALL=Off
-DWARNINGS=On
-DWARNING_AS_ERROR=On
-DUSE_LATEST_STD=On
-DVW_CXX_STANDARD=17
- name: Build
run: cmake --build build
- name: Unit tests
Expand Down
1 change: 1 addition & 0 deletions vowpalwabbit/core/include/vw/core/named_labels.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "vw/common/string_view.h"
#include "vw/core/vw_fwd.h"

#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
Expand Down
8 changes: 3 additions & 5 deletions vowpalwabbit/core/include/vw/core/reductions/epsilon_decay.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class epsilon_decay_data
{
public:
epsilon_decay_data(uint64_t model_count, uint64_t min_scope, double epsilon_decay_significance_level,
double epsilon_decay_estimator_decay, dense_parameters& weights, std::string epsilon_decay_audit_str,
bool constant_epsilon, uint32_t& feature_width, uint64_t _min_champ_examples, float initial_epsilon,
uint64_t shift_model_bounds, bool reward_as_cost, double tol_x, bool is_brentq, bool predict_only_model,
bool challenger_epsilon);
dense_parameters& weights, std::string epsilon_decay_audit_str, bool constant_epsilon, uint32_t& feature_width,
uint64_t _min_champ_examples, float initial_epsilon, uint64_t shift_model_bounds, bool reward_as_cost,
double tol_x, bool is_brentq, bool predict_only_model, bool challenger_epsilon);
void update_weights(float init_ep, VW::LEARNER::learner& base, VW::multi_ex& examples);
void promote_model(int64_t model_ind, int64_t swap_dist);
void rebalance_greater_models(int64_t model_ind, int64_t swap_dist, int64_t model_count);
Expand All @@ -44,7 +43,6 @@ class epsilon_decay_data
uint64_t _model_count;
uint64_t _min_scope;
double _epsilon_decay_significance_level; // Confidence interval
double _epsilon_decay_estimator_decay; // Count decay time constant
dense_parameters& _weights;
std::string _epsilon_decay_audit_str;
std::stringstream _audit_msg;
Expand Down
16 changes: 7 additions & 9 deletions vowpalwabbit/core/src/reductions/epsilon_decay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ float decayed_epsilon(float init_ep, uint64_t update_count)
}

epsilon_decay_data::epsilon_decay_data(uint64_t model_count, uint64_t min_scope,
double epsilon_decay_significance_level, double epsilon_decay_estimator_decay, dense_parameters& weights,
std::string epsilon_decay_audit_str, bool constant_epsilon, uint32_t& feature_width, uint64_t min_champ_examples,
float initial_epsilon, uint64_t shift_model_bounds, bool reward_as_cost, double tol_x, bool is_brentq,
bool predict_only_model, bool challenger_epsilon)
double epsilon_decay_significance_level, dense_parameters& weights, std::string epsilon_decay_audit_str,
bool constant_epsilon, uint32_t& feature_width, uint64_t min_champ_examples, float initial_epsilon,
uint64_t shift_model_bounds, bool reward_as_cost, double tol_x, bool is_brentq, bool predict_only_model,
bool challenger_epsilon)
: _model_count(model_count)
, _min_scope(min_scope)
, _epsilon_decay_significance_level(epsilon_decay_significance_level)
, _epsilon_decay_estimator_decay(epsilon_decay_estimator_decay)
, _weights(weights)
, _epsilon_decay_audit_str(std::move(epsilon_decay_audit_str))
, _constant_epsilon(constant_epsilon)
Expand Down Expand Up @@ -345,7 +344,6 @@ std::shared_ptr<VW::LEARNER::learner> VW::reductions::epsilon_decay_setup(VW::se
uint64_t model_count;
uint64_t min_scope;
float epsilon_decay_significance_level;
float epsilon_decay_estimator_decay;
std::string epsilon_decay_audit_str;
bool constant_epsilon = false;
uint64_t bonferroni_denominator;
Expand Down Expand Up @@ -439,9 +437,9 @@ std::shared_ptr<VW::LEARNER::learner> VW::reductions::epsilon_decay_setup(VW::se
bool is_brentq = opt_func == "brentq";

auto data = VW::make_unique<VW::reductions::epsilon_decay::epsilon_decay_data>(model_count, min_scope,
epsilon_decay_significance_level, epsilon_decay_estimator_decay, all.weights.dense_weights,
epsilon_decay_audit_str, constant_epsilon, all.reduction_state.total_feature_width, min_champ_examples,
initial_epsilon, shift_model_bounds, reward_as_cost, tol_x, is_brentq, predict_only_model, challenger_epsilon);
epsilon_decay_significance_level, all.weights.dense_weights, epsilon_decay_audit_str, constant_epsilon,
all.reduction_state.total_feature_width, min_champ_examples, initial_epsilon, shift_model_bounds, reward_as_cost,
tol_x, is_brentq, predict_only_model, challenger_epsilon);

// make sure we setup the rest of the stack with cleared interactions
// to make sure there are not subtle bugs
Expand Down
4 changes: 2 additions & 2 deletions vowpalwabbit/core/tests/epsilon_decay_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ TEST(EpsilonDecay, ScoreBoundsUnit)
uint32_t feature_width = 8;
VW::dense_parameters dense_weights(num_models);
epsilon_decay_data ep_data(
num_models, 100, .05, .1, dense_weights, "", false, feature_width, 0, 1.f, 0, false, 1e-6, "bisect", false, true);
num_models, 100, .05, dense_weights, "", false, feature_width, 0, 1.f, 0, false, 1e-6, "bisect", false, true);

// Set update counts to fixed values with expected horizon bound violation
size_t score_idx = 0;
Expand Down Expand Up @@ -341,7 +341,7 @@ TEST(EpsilonDecay, HorizonBoundsUnit)
uint32_t feature_width = 8;
VW::dense_parameters dense_weights(num_models);
epsilon_decay_data ep_data(
num_models, 100, .05, .1, dense_weights, "", false, feature_width, 0, 1.f, 0, false, 1e-6, "bisect", false, true);
num_models, 100, .05, dense_weights, "", false, feature_width, 0, 1.f, 0, false, 1e-6, "bisect", false, true);

// Set update counts to fixed values with expected horizon bound violation
size_t score_idx = 0;
Expand Down

0 comments on commit a541d85

Please sign in to comment.