Skip to content

Releases: Locamage/xprof-rs

xprof-rs v0.1.3

Choose a tag to compare

@github-actions github-actions released this 17 Oct 00:27

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 profiling profile keeps its line tables.
  • Each release also puts wheels on PyPI. pip install xprof-rs puts the binary on the PATH. 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 %.17g of the time in microseconds, for example 660215.41857099999. Before, xprof-rs wrote six decimal places, for example 660215.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_regex and trace_matchers options of the CLI find text as Python re does. 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 example missing ), unterminated subpattern at position 0.
  • When a CLI command returns an empty list in the dict format, 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 wrote 75212772.70507813.
  • For all option values, such as numbers, True and None, 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 reads 1,2 and (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=None gives the error '>' not supported between instances of 'NoneType' and 'int', and --output_type=1.5 gives Unsupported 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_utilization and get_kernel_utilization open each trace file before they read the profile. When a file is a broken link or you cannot read it, they give the PATH_ERROR of XProf. The error text is the text of Python, for example [Errno 2] No such file or directory. Before, they gave an INTERNAL_ERROR with the text "no data returned".
  • For a local path, compute_utilization and get_kernel_utilization give 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 host worker-0 in the file host.xplane.pb gives 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, not 18446744073709551615.
  • To find an event name that is a number, the CLI uses the rules of str.isdigit in 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 Multiplier stat of an op is not a double, its value is 0, as in XProf. Before, xprof-rs used 1.
  • When the _p, _c, _pt or _ct stat 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_ps or connection stat of an event is not an integer, its value is 0, as in XProf. The connection stats are run_id, queue_id, device_ordinal, core_type, request_id, queue_addr, id and iter_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_id stat of the host steps that is not a signed integer gives the group 0, as in XProf.
  • When the metadata plane has no program_id stat, 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 showed main and 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::StartRegion event starts a region when it has a _c stat 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 pbtxt format 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_events rounds 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 in avg_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=5 with no end time showed all events after 5 ms.
  • The trace viewer reads its time options as absl::SimpleAtod does. It accepts hexadecimal numbers after 0x, and it removes only ASCII spaces around the number. It reads resolution and unique_id as integers first. A negative time, NaN or infinity gives the same number of picoseconds as XProf on x86-64. Before, xprof-rs returned 404 for 0x10, and it showed different events for -1, NaN or infinity.
  • A search with search_metadata=true shows the stack frames of the full trace, as XProf does. Before, the stackFrames object had only the frames of the events that the search found, with different numbers.
  • A bitcast-convert instruction 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 types s1, s2, s4, u1, u2 and u4. Thus a bitcast-convert from s4 to u8 had the incorrect category.
  • When the overview data gives a negative number of steps, check_host_boundness keeps the negative number, as XProf does. Before, the number changed to 18446744073709551615, and the times were very large.

Fixes

  • Two get_xspace_proto commands 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 curl without --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...
Read more

xprof-rs v0.1.2

Choose a tag to compare

@github-actions github-actions released this 07 Oct 05:28

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_profile and get_profile_summary take 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_model takes 0.22 s, and get_device_information takes 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_viewer tool checks the file at the same time as it reads the trace. Before, the check ran first.

xprof-rs v0.1.1

Choose a tag to compare

@github-actions github-actions released this 06 Oct 09:20

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_stats takes 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

Choose a tag to compare

@github-actions github-actions released this 06 Oct 04:43

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_64 and aarch64, 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.1 by default. XProf listens on all interfaces. Use --host to change the address.
  • The README lists the features that are not available.