Repository navigation
Releases: Locamage/xprof-rs
Releases · Locamage/xprof-rs
Release list
xprof-rs v0.1.3
This release is faster, and it uses less memory on large profiles. More outputs are now the same as the outputs of XProf 2.23.2. The release binary is smaller, and PyPI has wheels of the binary.
Packages
- The Linux release binary is 21.5 MB. Before, it was 27.1 MB. Marin can put the binary without xz in its Iris bundle of 25 MiB. The binary has no debug symbols. Its TLS uses ring, not aws-lc. The compiler makes the network and cloud crates small, and it makes the other crates fast. On an 80 MB JAX CPU profile, the speed and the output do not change. The
profilingprofile keeps its line tables. - Each release also puts wheels on PyPI.
pip install xprof-rsputs the binary on thePATH. The wheel has no Python code. Thus a tool such as Iris can install xprof-rs with its Python packages, and the uploaded bundle does not contain the binary. - The source keeps the files of the user interface as plain files in
ui/. The build compresses the files into the binary. The served files do not change.
Output that is now the same as XProf
- The trace viewer writes the times as XProf does. XProf writes
%.17gof the time in microseconds, for example660215.41857099999. Before, xprof-rs wrote six decimal places, for example660215.418571. The two texts have the same value, but the bytes were different. The response is approximately 4% larger, and its first render takes approximately 5% more time. - The
plane_regex,event_regexandtrace_matchersoptions of the CLI find text as Pythonredoes. Before, they used the syntax of Rust. Thus$also matches before a final new line,(?i)uses the case rules of Python, and look-around, back references and conditional groups are available. A bad pattern gives the error message of Python, for examplemissing ), unterminated subpattern at position 0. - When a CLI command returns an empty list in the
dictformat, it prints nothing, as XProf does. Before, it printed[]. - When a number is halfway between two short texts, the CLI writes the text with the even last digit, as Python does. For example, 616143034000 / 8192 gives
75212772.70507812. Before, xprof-rs wrote75212772.70507813. - For all option values, such as numbers,
TrueandNone, the CLI gives the same output and errors as XProf. Before, xprof-rs changed many of these values to text, or it gave a different error. Fire reads1,2and(1,)as tuples,{1,2}as a set and{a:1}as a dict, and xprof-rs now keeps these kinds apart from lists. For example,--limit=Nonegives the error'>' not supported between instances of 'NoneType' and 'int', and--output_type=1.5givesUnsupported option type for key 'type': <class 'float'>. An error about an option value now occurs at the same step as in XProf. Thus an error about the session can occur first. compute_utilizationandget_kernel_utilizationopen each trace file before they read the profile. When a file is a broken link or you cannot read it, they give thePATH_ERRORof XProf. The error text is the text of Python, for example[Errno 2] No such file or directory. Before, they gave anINTERNAL_ERRORwith the text "no data returned".- For a local path,
compute_utilizationandget_kernel_utilizationgive data only when the file name contains the first host name of the profile. XProf has the same rule. For example, a profile of the hostworker-0in the filehost.xplane.pbgives the "no data returned" error. - When an event or a stat has no metadata, the CLI writes its ID as a signed number, as XProf does. For example, it writes
-1, not18446744073709551615. - To find an event name that is a number, the CLI uses the rules of
str.isdigitin Python. Thus²and٣are numbers, and½is not a number. - The normalized times of the op statistics change a double to an integer as XProf does on x86-64. A value that is too large gives 2^63, and a negative value wraps. Before, a very large time scale multiplier gave a different time scale for the roofline model.
- When the
Time Scale Multiplierstat of an op is not a double, its value is 0, as in XProf. Before, xprof-rs used 1. - When the
_p,_c,_ptor_ctstat of an event is not an integer, its value is 0, as in XProf. Thus the event connects to its producer or consumer for the groups and the flows of the trace viewer. Before, xprof-rs ignored the stat. - When the
device_offset_ps,device_duration_ps,step_idle_time_psor connection stat of an event is not an integer, its value is 0, as in XProf. The connection stats arerun_id,queue_id,device_ordinal,core_type,request_id,queue_addr,idanditer_num. Before, xprof-rs ignored these stats. Then a step had a different time, or the trace viewer did not show a flow. - A
group_idstat of the host steps that is not a signed integer gives the group 0, as in XProf. - When the metadata plane has no
program_idstat, the program ID of an HLO module comes from the digits at the end of its name. XProf has the same rule. Before, this failed when the metadata also had a display name. Then the op profile showedmainand no fused operations. - To find events by name, xprof-rs uses the name of the metadata, as XProf does, also when the metadata has a display name. This applies to memory events, threadpool regions, the roots and links of the groups, the step markers, and the framework ops of the host. Before, xprof-rs did not find these events.
- A
ThreadpoolListener::StartRegionevent starts a region when it has a_cstat of any type, as in XProf. Before, xprof-rs ignored the event when the stat was not an integer. Then the trace viewer did not show the region, or it showed a region from an earlier start. - xprof-rs uses an HLO module only when C++ protobuf can parse all of its proto, as XProf does. Before, xprof-rs showed a module with a bad nested field or with text that is not UTF-8. XProf removes such a module from the module list, the op profile and the HLO tools. Text in
pbtxtformat now also accepts unknown groups, as C++ protobuf does. - When a profile file is not a valid
XSpace, xprof-rs extracts no HLO modules from it, as XProf does. Before, it extracted the modules from the metadata plane, for example when an event name was not UTF-8. The check of the file and the extraction occur at the same time, so the extraction takes the same time. aggregate_xplane_eventsrounds the average duration one time, as Python does when it divides two integers. Before, a total of more than 2^53 ps sometimes gave a different last digit inavg_duration_ps.- The HTML page of the graph viewer and of the memory timeline has the same DOT text as XProf. Before, xprof-rs added a backslash before each backslash, for example in the backend configuration. xprof-rs still adds backslashes when the text has a backtick,
${,<!--or</script, because then the text can run as a script. - When the start time of the trace viewer is after the end time, the visible time is one instant at the start, as in XProf. This change occurs before an end time of 0 becomes the end of the trace. Before,
start_time_ms=5with no end time showed all events after 5 ms. - The trace viewer reads its time options as
absl::SimpleAtoddoes. It accepts hexadecimal numbers after0x, and it removes only ASCII spaces around the number. It readsresolutionandunique_idas integers first. A negative time, NaN or infinity gives the same number of picoseconds as XProf on x86-64. Before, xprof-rs returned 404 for0x10, and it showed different events for -1, NaN or infinity. - A search with
search_metadata=trueshows the stack frames of the full trace, as XProf does. Before, thestackFramesobject had only the frames of the events that the search found, with different numbers. - A
bitcast-convertinstruction is in the category "non-fusion elementwise" only when its input and output types have the same number of bits, as in XLA. Before, xprof-rs used 8 bits for the typess1,s2,s4,u1,u2andu4. Thus abitcast-convertfroms4tou8had the incorrect category. - When the overview data gives a negative number of steps,
check_host_boundnesskeeps the negative number, as XProf does. Before, the number changed to 18446744073709551615, and the times were very large.
Fixes
- Two
get_xspace_protocommands can save the same large profile at the same time. Each command gives a full file, and on a 1.7 GB profile each takes 2.1 s. Before, one command sometimes cut the file of the other command, and it waited 19 s for the disk. Each command writes a new file, and then it exchanges the new file with the old file. The extracted HLO modules also use this write. - The CLI finds a trace when you give only its file name in the current directory, for example
get_hosts host0.xplane.pb. Before, the command failed with "No .xplane.pb or .xspace.pb files found". - The server does not remove the files of a session that a download still writes, when the remote mirror is too large. Before, a long download sometimes lost its file, and the request failed with "Cannot write the mirror".
- A response of 4 GiB or more is complete when the client does not accept gzip, for example
curlwithout--compressed. Before, the server used the gzip size field, which keeps only the low 32 bits. Thus the response was too short. - A search of the trace viewer gives the events in the order of their levels. Thus the time delta from one event to the next can be less than zero. The delta then wraps, as in XProf. Before, a debug build of xprof-rs stopped with a panic. The output of the release build does not change.
User interface
- Charts that did not show now show. Before, a tool sometimes got its data before Google Charts loaded its packages. Then some charts stayed empty. Examples are the charts of the HLO op stats, the heap chart of the memory viewer, and the device charts of the framework op stats. Now th...
xprof-rs v0.1.2
The tools and the CLI commands are faster, and they use less memory. The responses do not change.
- On an 80 MB TPU v4 profile with 4 cores,
get_hlo_stats,get_top_hlo_ops,get_hlo_op_profileandget_profile_summarytake 0.14 s to 0.15 s. In 0.1.1, they took 0.29 s to 0.31 s. Their peak memory is approximately 40% less. get_roofline_modeltakes 0.22 s, andget_device_informationtakes 0.20 s. In 0.1.1, they took 0.30 s and 0.29 s.- The first request of the trace viewer takes 0.37 s. In 0.1.1, it took 0.41 s. The first request of the other tools takes 0.24 s to 0.26 s. In 0.1.1, it took 0.27 s to 0.32 s.
- The
trace_viewertool checks the file at the same time as it reads the trace. Before, the check ran first.
xprof-rs v0.1.1
The tools and the CLI commands are faster, and they use less memory. The responses do not change.
- On an 80 MB TPU v4 profile with 4 cores, the first request of the overview page takes 0.27 s. In 0.1.0, it took 0.52 s. The memory profile takes 0.13 s. In 0.1.0, it took 0.53 s.
- The CLI commands that read op statistics take 0.27 s to 0.32 s. In 0.1.0, they took 0.50 s to 0.57 s.
get_kernel_statstakes 77 ms. In 0.1.0, it took 0.79 s. - The peak memory of these CLI commands is approximately 20% less.
- xprof-rs uses version 2 of mimalloc.
xprof-rs v0.1.0
First release.
- Rust backend for the XProf trace viewer. The responses are the same as the responses of XProf 2.23.2.
- All XProf tools and the XProf agent CLI.
- Binaries for Linux on
x86_64andaarch64, and for macOS on Apple silicon. - The crate on crates.io:
cargo install --locked xprof-rs. - Remote log directories (
gs://,s3://,az://,http(s)://,file://). - The server listens on
127.0.0.1by default. XProf listens on all interfaces. Use--hostto change the address. - The README lists the features that are not available.