-
Notifications
You must be signed in to change notification settings - Fork 7
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
Hitting errors attempting to run dpugen #25
Comments
Hi,
I’m udating dpu gen as we speak, try same with dashgen that is finished and worked.
Sai is still being worked on to get all the updates from dash
This worked for me,
python -m dpugen.dash -o small.json
let me work on bringing sai up to date also (once sai is completed I’l lrelease again to pypi
Thanks,
Mircea Dan
From: Andy Fingerhut ***@***.***>
Sent: Thursday, December 14, 2023 9:14 AM
To: mgheorghe/dpugen ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [mgheorghe/dpugen] Hitting errors attempting to run dpugen (Issue #25)
All of the experiments I tried here were on an Ubuntu 20. 04 Desktop Linux system, freshly installed. If that is part of my problem, please recommend what OS and version you recommend. Try #1: attempt to use pip3 to install the dpugen package
ZjQcmQRYFpfptBannerStart
This Message is From an External Sender: Use caution opening files, clicking links or responding to requests.
ZjQcmQRYFpfptBannerEnd
All of the experiments I tried here were on an Ubuntu 20.04 Desktop Linux system, freshly installed. If that is part of my problem, please recommend what OS and version you recommend.
* Try #1<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen/pull/1__;!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-DtmywAwkD7c$>: attempt to use pip3 to install the dpugen package
sudo apt install python3.8-venv
cd $HOME
python3 -m venv venv-dpugen
source $HOME/venv-dpugen/bin/activate
pip3 install dpugen
# The following command recommended in the dpugen README page fails
# with the error shown:
# $ python3 -m dpugen.sai -h
# /home/andy/venv-dpugen/bin/python3: Error while finding module specification for 'dpugen.sai' (ModuleNotFoundError: No module named 'dpugen')
* Try #2<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen/pull/2__;!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-DtmyqJuLuyg$>: attempt to clone the source repo and run it from there
udo apt install python3.8-venv
cd $HOME
python3 -m venv venv-dpugen
source $HOME/venv-dpugen/bin/activate
cd $HOME
git clone https://github.com/mgheorghe/dpugen<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen__;!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-DtmyG2JYvio$>
cd dpugen
pip3 install -r requirements.txt
export PYTHONPATH="$HOME/dpugen:$HOME/venv-dpugen/lib/python3.8/site-packages"
# Now I get this error when trying to run sai.py
$ ./dpugen/sai.py -h
Traceback (most recent call last):
File "./dpugen/sai.py", line 10, in <module>
import dpugen.saigen.enis
File "/home/andy/dpugen/dpugen/saigen/enis.py", line 7, in <module>
from dpugen.confbase import (
ImportError: cannot import name 'ipa' from 'dpugen.confbase' (/home/andy/dpugen/dpugen/confbase.py)
It appears that ipa is defined here: https://github.com/mgheorghe/dpugen/blob/main/work/test_sai_sample.py#L17<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen/blob/main/work/test_sai_sample.py*L17__;Iw!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-DtmyoMiMK50$>
but it is not defined anywhere in the confbase.py source file. Even when I tried to change my local copy as shown in the diff below:
$ git diff . | cat
diff --git a/dpugen/confbase.py b/dpugen/confbase.py
index 0397ebf..045f28b 100644
…--- a/dpugen/confbase.py
+++ b/dpugen/confbase.py
@@ -14,6 +14,7 @@ from munch import DefaultMunch
from dpugen.dflt_params import dflt_params
+ipa = ipaddress.ip_address # optimization so the . does not get executed multiple times
socket_inet_ntoa = socket.inet_ntoa
struct_pack = struct.pack
I get a different error when trying to run sai.py shown below:
$ echo $PYTHONPATH
/home/andy/dpugen:/home/andy/venv-dpugen/lib/python3.8/site-packages
$ ./dpugen/sai.py -h
Traceback (most recent call last):
File "./dpugen/sai.py", line 18, in <module>
from .confbase import ConfBase
ImportError: attempted relative import with no known parent package
Any suggestions for something to do differently?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen/issues/25__;!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-Dtmye336Nmc$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AH3KKMFKBB6WFFXQAM7SEXDYJMXUNAVCNFSM6AAAAABAVF7VECVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DEMJTGEYDKOI__;!!I5pVk4LIGAfnvw!gYjNisKKnT9TwAFplz8w9WQvGjFepxmsIhPVaO-8Pac-Vnh7cjbX0YdttShDxB3U4i0qOP6jmOXxsvercLn7D7t-DtmymHiO5GU$>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
I do not see any commits on main since my comment was made. Are you making commits on a different branch that I should try? After your previous comment, on a freshly installed Ubuntu 20.04 VM I tried this sequence of commands:
and then the command you recommended gave this error message:
|
OK, I switched back to the VM where I ran dpugen from source code, and the command:
is doing something for several minutes. It is running about 8 threads to begin with, each of which gradually increases its memory usage over time, until the system runs out of RAM, one of the threads is probably killed off, and the rest continue to increase their memory usage until another is killed, etc. How much RAM do you run this command on? I have tried up to 24 GBytes of RAM on the VM, and it still consumes everything available before threads start getting killed off, and there is only one left which continues to increase. It finally finished after about 10 minutes, writing one file small.dpu_7.json that was 3.6 GBytes in size. Is this expected behavior? |
Hi,
So with the latest changes, I increased performance by a lot but I messed up the memory optimization done by Chris, working on fixing that before I make a release.
Json library slow but we can do item by item. Vs orjson that is very fast at saving huge files but it is all expanded in memory (I need to see how to put the custom formatter to orjson and get bets of both, speed and memory)
It is now set by default to generate the full smartswitch config and assumes 8 asics, you will get a 40G worth of text split between 8 files , file/asic (if you have 2 asics you get 2 threads generates 2 files and that will take longer)
256ENI 256M prefixes 25.6M routes …..
I’m also adding 2 profiles (ETA TBD, so far I just manualy update the acl/nsg/ip prefixs, and routes manualy):
Nano hero test : 256 ENI, but with 1 ACL per NSG (instead of 1000) and 1 prefix per ACL (instead of 100) 100000 times smaller than full hero test (this will validated all eni,s nsgs are there (basicaly all tables will be created with 1 entry per table
baby hero test : 256 ENI, 1000AACl …. But only 1 prefix per ACL 100 times smaller than the full hero test (this will validate hero test at 1% of the scale size, all tables + all NSGs will have the 1000 ACLs, but each acl will only have 1 ip
hero test : full scale – default values
on my machien i9-12900K 64G ram, NVME drive takes ~3-6 minutes to generate and peaks ~38G memory
I use EmEditor to open the files and look through them.
Memory problem comes from dash.py
def items(self):
result = []
for c in self.configs:
result.extend(c.items())
return result
ofcourse it can be set back to 1 asic and only 32 ENIs and coresponding nr of routes and it will take less memory.
Thanks,
Mircea Dan
From: Andy Fingerhut ***@***.***>
Sent: Thursday, December 14, 2023 4:37 PM
To: mgheorghe/dpugen ***@***.***>
Cc: Mircea Dan Gheorghe ***@***.***>; Comment ***@***.***>
Subject: Re: [mgheorghe/dpugen] Hitting errors attempting to run dpugen (Issue #25)
OK, I switched back to the VM where I ran dpugen from source code, and the command: python3 -m dpugen. dash -o small. json is doing something for several minutes. It is running about 8 threads to begin with, each of which gradually increases
ZjQcmQRYFpfptBannerStart
This Message is From an External Sender: Use caution opening files, clicking links or responding to requests.
ZjQcmQRYFpfptBannerEnd
OK, I switched back to the VM where I ran dpugen from source code, and the command:
python3 -m dpugen.dash -o small.json
is doing something for several minutes.
It is running about 8 threads to begin with, each of which gradually increases its memory usage over time, until the system runs out of RAM, one of the threads is probably killed off, and the rest continue to increase their memory usage until another is killed, etc.
How much RAM do you run this command on? I have tried up to 24 GBytes of RAM on the VM, and it still consumes everything available before threads start getting killed off, and there is only one left which continues to increase.
It finally finished after about 10 minutes, writing one file small.dpu_7.json that was 3.6 GBytes in size.
Is this expected behavior?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/mgheorghe/dpugen/issues/25*issuecomment-1857086333__;Iw!!I5pVk4LIGAfnvw!j0f1egoRTrh5CDD8pQ_pOzemz11MX7jhvwna76od8pm2rRKPuu0M41c-NsjDvbyzp3WcGs2DGorksaG28QJeBiSmNonBSJGqafY$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AH3KKMH3BMTGPGRLNNRYSZDYJOLULAVCNFSM6AAAAABAVF7VECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXGA4DMMZTGM__;!!I5pVk4LIGAfnvw!j0f1egoRTrh5CDD8pQ_pOzemz11MX7jhvwna76od8pm2rRKPuu0M41c-NsjDvbyzp3WcGs2DGorksaG28QJeBiSmNonB2DhfdiQ$>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Here is a proposed PR that allows you to enable multi-threaded generation as a command line option, but without that option, the default behavior is to generate configs for each DPU sequentially. Without that change, the latest code for a command like this one:
requires 128 GigaBytes of RAM to finish (about 16 GB of RAM for each of 8 threads, one per DPU). With that change, the same command requires about 16GB of RAM, because the memory allocated for each of the 8 DPUs is freed up between the generation of configs for each DPU. |
All of the experiments I tried here were on an Ubuntu 20.04 Desktop Linux system, freshly installed. If that is part of my problem, please recommend what OS and version you recommend.
It appears that
ipa
is defined here: https://github.com/mgheorghe/dpugen/blob/main/work/test_sai_sample.py#L17but it is not defined anywhere in the confbase.py source file. Even when I tried to change my local copy as shown in the diff below:
I get a different error when trying to run sai.py shown below:
Any suggestions for something to do differently?
The text was updated successfully, but these errors were encountered: