nviennot/core-to-core-latency

question about the results.ipynb

edisonchan opened this issue · 1 comments

I have install jupyterlab on windows 11 and try to run the results.ipynb with:
jupyter-lab results.ipynb

and then add a cell:

cpu = "Intel Core i7-11700K @ 8 Cores (Rocket Lake, 11th gen)"
fname = "D:/backup/benchmark/core_to_core_latency/Intel Core i7-11700K.csv"
m = load_data(fname)

n1=8

m = load_data(fname)
n = 8
show_heapmap(m[::2,::2], title=cpu)

show_heapmap(np.diag(m[::2,1::2]).reshape((1,n)), yticks=False, figsize=(3.5, 4),
             title=cpu, subtitle="Hyper-thread same-core latency")

run the cell above, I got error message:
`---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1083, in pandas._libs.parsers.TextReader._convert_tokens()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1233, in pandas._libs.parsers.TextReader._convert_with_dtype()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1246, in pandas._libs.parsers.TextReader._string_convert()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1444, in pandas._libs.parsers._string_box_utf8()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

During handling of the above exception, another exception occurred:

UnicodeDecodeError Traceback (most recent call last)
Cell In [12], line 3
1 cpu = "Intel Core i7-11700K @ 8 Cores (Rocket Lake, 11th gen)"
2 fname = "D:/backup/benchmark/core_to_core_latency/Intel Core i7-11700K.csv"
----> 3 m = load_data(fname)
5 n1=8
7 m = load_data(fname)

Cell In [5], line 2, in load_data(filename)
1 def load_data(filename):
----> 2 m = np.array(pd.read_csv(filename, header=None))
3 return np.tril(m) + np.tril(m).transpose()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util_decorators.py:211, in deprecate_kwarg.._deprecate_kwarg..wrapper(*args, **kwargs)
209 else:
210 kwargs[new_arg_name] = new_arg_value
--> 211 return func(*args, **kwargs)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\util_decorators.py:317, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, **kwargs)
311 if len(args) > num_allow_args:
312 warnings.warn(
313 msg.format(arguments=arguments),
314 FutureWarning,
315 stacklevel=find_stack_level(inspect.currentframe()),
316 )
--> 317 return func(*args, **kwargs)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\io\parsers\readers.py:950, in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)
935 kwds_defaults = _refine_defaults_read(
936 dialect,
937 delimiter,
(...)
946 defaults={"delimiter": ","},
947 )
948 kwds.update(kwds_defaults)
--> 950 return _read(filepath_or_buffer, kwds)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\io\parsers\readers.py:611, in _read(filepath_or_buffer, kwds)
608 return parser
610 with parser:
--> 611 return parser.read(nrows)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\io\parsers\readers.py:1772, in TextFileReader.read(self, nrows)
1765 nrows = validate_integer("nrows", nrows)
1766 try:
1767 # error: "ParserBase" has no attribute "read"
1768 (
1769 index,
1770 columns,
1771 col_dict,
-> 1772 ) = self._engine.read( # type: ignore[attr-defined]
1773 nrows
1774 )
1775 except Exception:
1776 self.close()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py:243, in CParserWrapper.read(self, nrows)
241 try:
242 if self.low_memory:
--> 243 chunks = self._reader.read_low_memory(nrows)
244 # destructive to chunks
245 data = _concatenate_chunks(chunks)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:808, in pandas._libs.parsers.TextReader.read_low_memory()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:890, in pandas._libs.parsers.TextReader._read_rows()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1037, in pandas._libs.parsers.TextReader._convert_column_data()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1090, in pandas._libs.parsers.TextReader._convert_tokens()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1233, in pandas._libs.parsers.TextReader._convert_with_dtype()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1246, in pandas._libs.parsers.TextReader._string_convert()

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_libs\parsers.pyx:1444, in pandas._libs.parsers._string_box_utf8()

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte`

how can I fix this problem?

conver the csv file to to utf-8 would fix this problem