-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate simplified version of fuzzy-based matchmaking algorithm #12
Comments
Universal Assumption: all destinations in question are getting jobs only from Galaxy First, we have a list of destinations that actually "can" take the job, i.e. for each of these destinations: Match(j.requirements,d.specifications) > 0. what we need is an ordered list of these destinations based on the degree of matching, i.e. which d is the best for j Second, we have a simple logic that is based on: queue size (how many jobs are currently queued to d) and the distance (latitude and longitude based distance calculation between the destination and the job input dataset location) Now we want to improve this logic as we have new information available, about destination (d) and jobs of a specific tool (t):
Based on all the above, the new logic will be composed |
Scheduling algorithm logic:
Algorithm logic:
|
@pauldg and I were discussing:
|
A temp implementation of the algorithm: Input:
def calculate_matching_score(destination: dict) -> float:
"""
Calculate the matching score between a job and a destination.
"""
median_waiting_time = destination.get('median_waiting_time', None)
queue_size = destination.get('queue_size', 1)
median_running_time = destination.get('median_running_time', None)
running_jobs = destination.get('running_jobs', 1)
# Queue matching factor (qm).
if median_waiting_time > 0 and queue_size > 0:
qm = 1 / (median_waiting_time * queue_size)
else:
qm = float('inf')
# Compute matching factor (cm).
if median_running_time > 0 and running_jobs > 0:
cm = 1 / (median_running_time * running_jobs)
else:
cm = float('inf')
# Final matching score
return qm + cm
def select_best_destination(job_requirements: dict, destinations: list) -> list:
"""
Selects the best destination for a job based on job requirements and destination metrics.
"""
cpu_required = job_requirements['cpu_cores']
memory_required = job_requirements['memory']
# Filter out destinations that can't meet basic requirements based on the "real-time" data
viable_destinations = []
for dest in destinations:
if dest['unclaimed_cores'] > cpu_required and dest['unclaimed_memory'] > memory_required:
viable_destinations.append(dest)
# Sort by distance to input data location (ascending)
viable_destinations.sort(key=lambda x: x.get('distance_to_data', float('inf')))
# Calculate matching scores for each viable destination
for dest in viable_destinations:
dest['matching_score'] = calculate_matching_score(dest)
# Sort by matching score (descending)
viable_destinations.sort(key=lambda x: x['matching_score'], reverse=True)
return viable_destinations |
Ok, as we are now able to collect this information:
This is excellent :) @sanjaysrikakulam your code is very good as a start. Now I think we should go with the usage of the three above parameter values as historical information, e.g. taking the collective historical # free cpus, # free memory, etc. from the DB and feed that into the Fuzzy input membership function. We can start with three Fuzzy membership functions: CPU, Memory, and Distance |
The current version here already uses the unclaimed CPU, memory, and distance (but I'm not sure what you mean by "as historical information"). here is the updated code:
|
In the context of meta-scheduling for Galaxy, it is crucial to collect histograms of available resources from the compute clusters (endpoints), rather than a collective or aggregate figure representing free CPUs and memory. This is because the resources in a cluster are spread across multiple machines, and each machine may have varying numbers of free CPUs and memory. To capture this diversity accurately, a histogram approach should be used. Specifically, the histogram would report the number of machines in the cluster that have X number of free CPUs and X amount of free memory. This allows for a more detailed and accurate picture of the available resources in each cluster. The histogram-like data would resemble the fuzzification process used in the fuzzy matchmaking algorithm described in the DAIS2014 paper. In that paper, fuzzy sets are used to categorize resource availability in degrees, such as "low," "medium," and "high," allowing for flexible matching between job requirements and available resources. By using histograms for resource availability, we can apply similar fuzzy logic techniques to match jobs with compute clusters more precisely, taking into account the full spectrum of resource availability on each machine, rather than a simple total number. |
Can be something like this
|
Need @abdulrahmanazab to help written/graphical version of the algorithm using the stats we have which we can then integrate in the code base.
The text was updated successfully, but these errors were encountered: