Skip to content

Commit

Permalink
common: add env configuration for scheduling credit (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhuyb authored and ymjiang committed Jul 23, 2019
1 parent 779429c commit f8a367f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions byteps/common/scheduled_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,18 @@ BytePSScheduledQueue::BytePSScheduledQueue(QueueType type) {
_is_scheduled = false;
}

size_t credit_in_partition = BytePSGlobal::GetNccl()->GetGroupSize() + 1;
if (getenv("BYTEPS_SCHEDULING_CREDIT")) {
credit_in_partition = atoi(getenv("BYTEPS_SCHEDULING_CREDIT"));
}
if (!credit_in_partition) {
_is_scheduled = false;
}

_qt = type;
_credits = _is_scheduled
? BytePSGlobal::GetPartitionBound() *
(BytePSGlobal::GetNccl()->GetGroupSize() + 1)
: 34359738368; // 32GB, basically disabling credit control
? BytePSGlobal::GetPartitionBound() * credit_in_partition
: 34359738368; // 32GB, basically disabling credit control
_rt = nullptr;

switch (_qt) {
Expand Down

0 comments on commit f8a367f

Please sign in to comment.