Fix jaccl init bug (#3418)

This commit is contained in:
Angelos Katharopoulos
2026-04-16 01:23:35 -07:00
committed by GitHub
parent dec6b4d10f
commit 8e649be4d0
+10 -7
View File
@@ -190,13 +190,16 @@ bool is_available() {
std::shared_ptr<Group> init(bool strict /* = false */) {
auto cfg = Config::from_env();
if (!cfg.has_value() && strict) {
std::ostringstream msg;
msg << "[jaccl] You need to provide via environment variables a rank "
<< "(JACCL_RANK/MLX_RANK), a device file (JACCL_IBV_DEVICES/"
<< "MLX_IBV_DEVICES) and a coordinator ip/port (JACCL_COORDINATOR/"
<< "MLX_JACCL_COORDINATOR).";
throw std::runtime_error(msg.str());
if (!cfg.has_value()) {
if (strict) {
std::ostringstream msg;
msg << "[jaccl] You need to provide via environment variables a rank "
<< "(JACCL_RANK/MLX_RANK), a device file (JACCL_IBV_DEVICES/"
<< "MLX_IBV_DEVICES) and a coordinator ip/port (JACCL_COORDINATOR/"
<< "MLX_JACCL_COORDINATOR).";
throw std::runtime_error(msg.str());
}
return nullptr;
}
return init(*cfg, strict);