-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Resume Related to #19 - Generate the telemetry info about the job running in the Runtime. ## Details - [x] Add gen_telemetry.py function to generate the file - [x] Add it to the kernel controller - [x] Get job id from run_sampler.py - [x] Get times info (queue vs simu) - [x] Get size of the payload - [x] Add view_telemetry endpoint as cli - [x] Add unittests - [x] Edit requirements
- Loading branch information
Showing
15 changed files
with
240 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ fire==0.4.0 | |
qiskit | ||
qiskit_ibm_runtime | ||
pandas==1.4.1 | ||
pyarrow | ||
pyarrow==7.0.0 |
Binary file modified
BIN
-16 Bytes
(100%)
resources/kernel_metadata/ibmq_qasm_simulator/kernels-10-ideal.csv
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""Data functions and classes.""" | ||
|
||
from .gen_data import kernel_metadata | ||
from .gen_telemetry import kernel_telemetry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
""" | ||
############################################# | ||
# | ||
# gen_telemetry.py | ||
# | ||
# program to generate telemetry | ||
# | ||
# | ||
############################################# | ||
""" | ||
|
||
import os | ||
import pandas as pd | ||
|
||
|
||
def kernel_telemetry( | ||
circuit_tpl_id: [int], | ||
job_id: str, | ||
time_queue: float, | ||
time_simu: float, | ||
payload_size: int, | ||
width: int, | ||
layer: int, | ||
) -> str: | ||
"""Function generate telemetry metadata files. | ||
Args: | ||
circuit_tpl_id: list of circuit id to run as template | ||
job_id: id of the experiment | ||
time_queue: time stuck in the queue | ||
time_simu: duration of running everything | ||
payload_size: size of the payload send into the Runtime | ||
width: number of qubits | ||
layer: number of reps for the tpl | ||
Returns: | ||
Telemetry file name | ||
""" | ||
data_name = "telemetry_info.csv" | ||
current_dir = os.path.dirname(os.path.abspath(__file__)) | ||
dest = "../../resources/kernel_metadata" | ||
if os.path.exists("{}/{}/{}".format(current_dir, dest, data_name)): | ||
old_file = pd.read_feather("{}/{}/{}".format(current_dir, dest, data_name)) | ||
|
||
list_width = old_file["width"].tolist() | ||
list_width.append(width) | ||
list_layers = old_file["layers"].tolist() | ||
list_layers.append(layer) | ||
list_circuit_id = old_file["circuit_id"].tolist() | ||
list_circuit_id.append(str(circuit_tpl_id)) | ||
list_job_id = old_file["job_id"].tolist() | ||
list_job_id.append(job_id) | ||
list_time_queue = old_file["time_queue"].tolist() | ||
list_time_queue.append(time_queue) | ||
list_time_simu = old_file["time_simu"].tolist() | ||
list_time_simu.append(time_simu) | ||
list_payload_size = old_file["payload_size"].tolist() | ||
list_payload_size.append(payload_size) | ||
else: | ||
list_width = [width] | ||
list_layers = [layer] | ||
list_circuit_id = [str(circuit_tpl_id)] | ||
list_job_id = [job_id] | ||
list_time_queue = [time_queue] | ||
list_time_simu = [time_simu] | ||
list_payload_size = [payload_size] | ||
|
||
fea_file = { | ||
"width": list_width, | ||
"layers": list_layers, | ||
"circuit_id": list_circuit_id, | ||
"job_id": list_job_id, | ||
"time_queue": list_time_queue, | ||
"time_simu": list_time_simu, | ||
"payload_size": list_payload_size, | ||
} | ||
|
||
data_fea = pd.DataFrame(fea_file) | ||
|
||
data_fea.to_feather("{}/{}/".format(current_dir, dest) + data_name) | ||
|
||
return data_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.