codecarbon plugin issues
See original GitHub issuehttps://github.com/huggingface/transformers/pull/12304 added the codecarbon
plugin and there are multiple issues with it:
- it needs to be documented in
along all the other plugins
- It doesn’t respect user’s logging level. It needs to read the set for the current rank log-level and pass it explicitly to the object instance here:
via the log_level
argument (but which expects a string like “warning” and not the real logging.WARNING
which is normally used, so one needs to remap from real logging
level to the string CC expects.
- same logs are logged more than once in different formats:
[codecarbon INFO @ 19:33:14] Tracking Nvidia GPU via pynvml
[codecarbon INFO @ 19:33:14] Tracking Intel CPU via RAPL interface
08/23/2021 19:33:14 - INFO - codecarbon - Tracking Nvidia GPU via pynvml
08/23/2021 19:33:14 - INFO - codecarbon - Tracking Intel CPU via RAPL interface
- it breaks the training as it can’t find some server.
Traceback (most recent call last):
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='get.geojs.io', port=443): Max retries exceeded with url: /v1/ip/geo.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcd95312700>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/nvme1/code/huggingface/codecarbon/codecarbon/core/util.py", line 10, in suppress
yield
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/mnt/nvme1/code/huggingface/codecarbon/codecarbon/emissions_tracker.py", line 348, in stop
emissions_data = self._prepare_emissions_data()
File "/mnt/nvme1/code/huggingface/codecarbon/codecarbon/emissions_tracker.py", line 367, in _prepare_emissions_data
geo: GeoMetadata = self._get_geo_metadata()
File "/mnt/nvme1/code/huggingface/codecarbon/codecarbon/emissions_tracker.py", line 612, in _get_geo_metadata
return GeoMetadata.from_geo_js(self._data_source.geo_js_url)
File "/mnt/nvme1/code/huggingface/codecarbon/codecarbon/external/geography.py", line 83, in from_geo_js
response: Dict = requests.get(url, timeout=0.5).json()
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/home/stas/anaconda3/envs/py38-pt19/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='get.geojs.io', port=443): Max retries exceeded with url: /v1/ip/geo.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcd95312700>: Failed to establish a new connection: [Errno 111] Connection refused'))
08/23/2021 19:33:20 - WARNING - codecarbon - stopping.
This part of CC never worked for me. It always fails here for me and not just in this integration. Only Offline version of the tracker works w/o this failure. Could we use the offline tracker by default instead?
To reproduce - I run:
python examples/pytorch/translation/run_translation.py --model_name_or_path google/mt5-small --do_train --source_lang en --target_lang ro --dataset_name wmt16 --dataset_config_name ro-en --output_dir output_dir --per_device_train_batch_size=4 --logging_step 2 --save_steps 0 --fp16 --max_train_samples 10 --save_total_limit 0 --overwrite_output_dir --save_strategy no
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Issues · mlco2/codecarbon - GitHub
Issues list ; Inconsistent units in EmissionsData object between emissions and emissions_rate · #346 opened 16 days ago · brother-wolf ; The codecarbon...
Read more >Solved: Re: Install Python packages - SMOTE and codecarbon ...
I am trying to use codecarbon and SMOTE on my dataset through my own Python code. What would be the best way to...
Read more >Code Carbon: Calculate and visualize code's C02 impact
Machine learning has made huge advancements in the past couple of years. We now have ML models helping doctors catch disease early.
Read more >Code Carbon | All Things Flutter and Fuchsia
If you're thinking about getting CRM software for your company, it's high time to think over its capabilities and see if it's worth...
Read more >Plugin List — pytest documentation
name summary last release status requi...
pytest‑accept A pytest‑plugin for updating doctest outputs Jan 07, 2022 N/A pytes...
pytest‑addons‑test 用于测试pytest的插件 Aug 02, 2021 N/A pytes...
pytest‑aio...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
will add when I’m back from the leave
Got it. My guess is the
geojs
service is not available in some countries. Let me see how we can add an offline option.