Skip to content
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

iteration #11

Open
fnoorbin opened this issue Jul 28, 2020 · 2 comments
Open

iteration #11

fnoorbin opened this issue Jul 28, 2020 · 2 comments

Comments

@fnoorbin
Copy link

Hi,
Is it pyRAPL available for windows? what can be used for windows?

when the "number" is set >1, is a for loop required to run the function or measureit decorator measures it in iteration of number itself?

@kshivvy
Copy link

kshivvy commented Feb 24, 2021

@altor @chakib-belgaid @rouvoy

I also have the same question as @fnoorbin, I'm trying to profile energy consumption on Windows but when I end up with the following stack trace:

  File "C:\Users\kesha\Documents\NCSA\nengo.LIF_0.001_v4_nengo_synpase0.1_mp\reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\sensor.py", line 59, in __init__
    self._device_api[device] = DeviceAPIFactory.create_device_api(device, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 186, in create_device_api
    return PkgAPI(socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 137, in __init__
    DeviceAPI.__init__(self, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 68, in __init__
    all_socket_id = get_socket_ids()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 49, in get_socket_ids
    for cpu_id in cpu_ids():
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 31, in cpu_ids
    api_file = open('/sys/devices/system/cpu/present', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/present'

When I run the same code on a Linux system, I end up with the following stack trace:

Traceback (most recent call last):
  File "/jet/home/kshivvy/spiking_reservoir_rl_elastica/reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/sensor.py", line 68, in __init__
    raise PyRAPLCantRecordEnergyConsumption(None)
pyRAPL.exception.PyRAPLCantRecordEnergyConsumption

Does your package support Windows, and if not do you know how I can profile how much energy certain lines of my Python code use?

@fnoorbin
Copy link
Author

@altor @chakib-belgaid @rouvoy

I also have the same question as @fnoorbin, I'm trying to profile energy consumption on Windows but when I end up with the following stack trace:

  File "C:\Users\kesha\Documents\NCSA\nengo.LIF_0.001_v4_nengo_synpase0.1_mp\reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\sensor.py", line 59, in __init__
    self._device_api[device] = DeviceAPIFactory.create_device_api(device, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 186, in create_device_api
    return PkgAPI(socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 137, in __init__
    DeviceAPI.__init__(self, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 68, in __init__
    all_socket_id = get_socket_ids()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 49, in get_socket_ids
    for cpu_id in cpu_ids():
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 31, in cpu_ids
    api_file = open('/sys/devices/system/cpu/present', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/present'

When I run the same code on a Linux system, I end up with the following stack trace:

Traceback (most recent call last):
  File "/jet/home/kshivvy/spiking_reservoir_rl_elastica/reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/sensor.py", line 68, in __init__
    raise PyRAPLCantRecordEnergyConsumption(None)
pyRAPL.exception.PyRAPLCantRecordEnergyConsumption

Does your package support Windows, and if not do you know how I can profile how much energy certain lines of my Python code use?

@kshivvy
This package could be used only with Linux and not Windows.
But I am no more able to use it with Linux, I think some permissions have changed by the Linux updates and then it was not accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants