-
Notifications
You must be signed in to change notification settings - Fork 127
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
Overhaul Qiskit Experiments (RFC0014) #1268
Comments
can I use inliner module to prevent a huge thread stack or should I use processes |
Also, Can you assign the first job to me |
I'm not sure if inliner module helps performance improvement in our case. Indeed it optimizes bytecode and reduces the function call overhead, but we are targeting 1000 parallel post-processing tasks for efficient experiment execution on 1000 qubit device. I think sub-processing is necessary technology to avoid Python GIL, but still open to another suggestion (e.g. implementing everything with Rust). Also I'm bit hesitate to add inliner to dependency because likely the software doesn't have any public release. |
Can we use pointers in Python to prevent object copying for different processes if this works we don't need ray or shared memory |
I am trying to use tox but I got bunch of errors
|
Pointers could be an option. However I don't think tight coupling between analysis and experiment data is the way to go. Namely, current Regarding the tox issue, I think this is a problem of your IDE (VS code?). I'm only using MacOS and not eligible to support Windows issue. Probably @mtreinish can help? |
The first task of |
Check for pointersfrom multiprocessing import Process
def multi(obj):
print(id(obj[0]))
if __name__ == '__main__':
obj = (1,2,3)
p1=Process(target=multi,args=(obj,))
p2=Process(target=multi,args=(obj,))
p1.start()
p2.start()
p1.join()
p2.join()
Check for tuple objectfrom multiprocessing import Process
def multi(obj):
print(id(obj))
if __name__ == '__main__':
obj = (1,2,3)
p1=Process(target=multi,args=(obj,))
p2=Process(target=multi,args=(obj,))
p1.start()
p2.start()
p1.join()
p2.join()
I tested it on Windows 11 but, I think it is a Python trick so it has to work on other os |
I ran tox on my Linux laptop, and it succeded. I think it is about os incompatibility or something like that |
print("0: " + str(getsizeof(table_format)))
print("1: " + str(getsizeof(tuple(table_format.values()))) + "len: " + str(len(table_format.items())))
print("2: "+ str(getsizeof((tuple(table_format.values()),))) + "len: " + str(len(((table_format.items()),))))
There is size compression. Dict is better than tuple, but using dict or tuple and getting elements from them may be ugly. Will we use them to prevent copying overhead ? Also, I found this line: expdata.add_analysis_results(**table_format) If we call this on the executor first issue will be solved but, I did not change the code, because I think test cases have been written according to the current implementation. When I change other components and add return statements, I will delete that line. |
I checked important thing again: print("sizeof: " + str(getsizeof(Animated.data)))
Animated.data is from my game project that uploads game assets at compile time. We can't use dict, because the size of dict changes over time ( adding variables ). Therefore, we have to use tuple or dict in dict. |
Epic issue to manage implementation of RFC0014
Migration plan:
Optional:
The text was updated successfully, but these errors were encountered: