File tree 1 file changed +7
-2
lines changed
python/tvm/meta_schedule/cost_model
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -755,7 +755,12 @@ def _fmt_metric(value, show_stdv=True):
755
755
raise ValueError ("wrong metric value" , value )
756
756
757
757
import xgboost as xgb
758
- from xgboost import rabit # type: ignore
758
+
759
+ # make it compatible with xgboost<1.7
760
+ try :
761
+ from xgboost import rabit as collective # type: ignore
762
+ except ImportError :
763
+ from xgboost import collective # type: ignore
759
764
760
765
try :
761
766
from xgboost .training import aggcv # type: ignore
@@ -841,7 +846,7 @@ def _fmt_metric(value, show_stdv=True):
841
846
elif epoch - best_iteration >= self .early_stopping_rounds :
842
847
best_msg = self .state ["best_msg" ]
843
848
844
- if self .verbose_eval and rabit .get_rank () == 0 :
849
+ if self .verbose_eval and collective .get_rank () == 0 :
845
850
logger .debug ("XGB stopped. Best iteration: %s " , best_msg )
846
851
# instead of raising EarlyStopException, returning True to end the training
847
852
return True
You can’t perform that action at this time.
0 commit comments