Skip to content

Commit

Permalink
use only dedicated when in need of it + refactor for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Joon-Klaps committed Jan 10, 2025
1 parent 1240bbb commit 0208521
Showing 1 changed file with 39 additions and 23 deletions.
62 changes: 39 additions & 23 deletions conf/vsc_kul_uhasselt.config
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ def limitTaskTime(time, maxTime) {
* @return Queue name based on task requirements
*/
def determineGeniusQueue = { task ->
if (task.memory >= MEMORY_THRESHOLD_GENIUS) {
if (task.time >= TIME_THRESHOLD) {
return AVAILABLE_QUEUES.contains('dedicated_big_bigmem') ? 'dedicated_big_bigmem' : 'bigmem_long'
}
return 'bigmem'
def isHighMemory = task.memory >= MEMORY_THRESHOLD_GENIUS
def isLongRunning = task.time >= TIME_THRESHOLD
def hasDedicatedBigmem = AVAILABLE_QUEUES.contains('dedicated_big_bigmem')

if (isHighMemory) {
return isLongRunning ?
(hasDedicatedBigmem ? 'dedicated_big_bigmem' : 'bigmem_long') :
'bigmem'
}
return task.time >= TIME_THRESHOLD ? 'batch_long' : 'batch'

return isLongRunning ? 'batch_long' : 'batch'
}

/*
Expand All @@ -111,14 +115,22 @@ def determineGeniusQueue = { task ->
* @return GPU queue name based on task requirements
*/
def determineGeniusGpuQueue = { task ->
if (task.memory >= MEMORY_THRESHOLD_GENIUS) {
return task.time >= TIME_THRESHOLD ? 'gpu_v100_long' : 'gpu_v100'
def isHighMemory = task.memory >= MEMORY_THRESHOLD_GENIUS
def isLongRunning = task.time >= TIME_THRESHOLD
def hasDedicatedGpu = AVAILABLE_QUEUES.contains('dedicated_rega_gpu')
def hasAmdGpu = AVAILABLE_QUEUES.contains('amd')

if (isHighMemory) {
return isLongRunning ? 'gpu_v100_long' : 'gpu_v100'
}
if (task.time >= TIME_THRESHOLD) {
return AVAILABLE_QUEUES.contains('dedicated_rega_gpu') ? 'dedicated_rega_gpu' :
AVAILABLE_QUEUES.contains('amd') ? 'amd_long' : 'gpu_p100_long'

if (isLongRunning) {
if (hasDedicatedGpu) return 'dedicated_rega_gpu'
if (hasAmdGpu) return 'amd_long'
return 'gpu_p100_long'
}
return AVAILABLE_QUEUES.contains('amd') ? 'amd' : 'gpu_p100'

return hasAmdGpu ? 'amd' : 'gpu_p100'
}

/*
Expand All @@ -128,16 +140,19 @@ def determineGeniusGpuQueue = { task ->
* @return Queue name based on task requirements and availability
*/
def determineWiceQueue = { task ->
if (task.memory >= MEMORY_THRESHOLD_WICE) {
if (AVAILABLE_QUEUES.contains('dedicated_big_bigmem')) {
def isHighMemory = task.memory >= MEMORY_THRESHOLD_WICE
def isLongRunning = task.time >= TIME_THRESHOLD
def hasDedicatedQueue = AVAILABLE_QUEUES.contains('dedicated_big_bigmem')

if (isHighMemory) {
if (isLongRunning && hasDedicatedQueue) {
return 'dedicated_big_bigmem'
} else {
task.time = limitTaskTime(task.time, TIME_THRESHOLD)
return 'bigmem,hugemem'
}
task.time = limitTaskTime(task.time, TIME_THRESHOLD)
return 'bigmem,hugemem'
}

return task.time >= TIME_THRESHOLD ?
return isLongRunning ?
'batch_long,batch_icelake_long,batch_sapphirerapids_long' :
'batch,batch_sapphirerapids,batch_icelake'
}
Expand All @@ -150,19 +165,20 @@ def determineWiceQueue = { task ->
*/
def determineWiceGpuQueue = { task ->
def isHighMemory = task.memory >= MEMORY_THRESHOLD_WICE
def isDedicatedQueue = isHighMemory ?
def isLongRunning = task.time >= TIME_THRESHOLD
def hasDedicatedQueue = isHighMemory ?
AVAILABLE_QUEUES.contains('dedicated_big_gpu_h100') :
AVAILABLE_QUEUES.contains('dedicated_big_gpu')

if (task.time >= TIME_THRESHOLD && !isDedicatedQueue) {
if (isLongRunning && !hasDedicatedQueue) {
task.time = limitTaskTime(task.time, TIME_THRESHOLD)
}

if (isHighMemory) {
return isDedicatedQueue ? 'dedicated_big_gpu_h100' : 'gpu_h100'
} else {
return isDedicatedQueue ? 'dedicated_big_gpu' : 'gpu_a100,gpu'
return (isLongRunning && hasDedicatedQueue) ? 'dedicated_big_gpu_h100' : 'gpu_h100'
}

return (isLongRunning && hasDedicatedQueue) ? 'dedicated_big_gpu' : 'gpu_a100,gpu'
}

/*
Expand Down

0 comments on commit 0208521

Please sign in to comment.