blis icon indicating copy to clipboard operation
blis copied to clipboard

Add support for systemless mode

Open fgvanzee opened this issue 5 years ago • 10 comments

As mentioned in [1], the goal is to allow BLIS to build and link on systems with minimal or nonexistent operating systems. This includes (but is not limited to) stripping use of pthreads, which is still required of sequential builds for thread safety.

Task list:

  • [ ] build system
    • [ ] add configure option
    • [ ] add help text
    • [ ] add configure option defs in bli_config.h.in
    • [ ] make -lpthread linkage conditional on configure option
  • [ ] source code
    • [ ] neutralize bli_pthread layer implementation with cpp guards

[1] https://groups.google.com/g/blis-devel/c/CuT-iFPHXa4/m/G4j7dHzlAgAJ

fgvanzee avatar Nov 10 '20 19:11 fgvanzee

As previously mentioned on the mailing list, I've done some naive changes to de-pthread the library which didn't quite work out. I thought I'd share what I've done: https://gist.github.com/stepannassyr/18b22b7af5f5bc7a9824be968c676159

stepannassyr avatar Nov 10 '20 23:11 stepannassyr

@stepannassyr Thank you for sharing this gist. I'll review it as I write and prepare my changes for commit.

fgvanzee avatar Nov 11 '20 23:11 fgvanzee

@stepannassyr Is the time.h header (clock_gettime() and friends) and corresponding -lrt link option available in your environment? (See the man page for clock_gettime() for more info.)

fgvanzee avatar Nov 12 '20 23:11 fgvanzee

@stepannassyr https://github.com/stepannassyr Is the time.h header ( clock_gettime() and friends) and corresponding -lrt link option available in your environment?

I’m not sure why this is in BLIS at all, at least in the release version. Does BLIS provide its own timer as a user convenience?

-- Jeff Hammond [email protected] http://jeffhammond.github.io/

jeffhammond avatar Nov 16 '20 03:11 jeffhammond

@jeffhammond Yes, BLIS defines bli_clock() (and bli_clock_min_diff()) for timing purposes [1]. bli_clock() is used in all of our performance-timing infrastructure. How it is defined differs based on operating system, and for that reason I feel that it is a natural thing for BLIS to provide rather than thrust it upon the application to figure out.

[1] https://github.com/flame/blis/blob/master/frame/base/bli_clock.c

fgvanzee avatar Nov 16 '20 16:11 fgvanzee

@fgvanzee As communicated via email, on gem5, -lrt and clock_gettime is available.

However, I have the following answer from one of the interested parties:

The environment of concern is a bare-metal setup. One should not assume the availability of librt and clock_gettime().

stepannassyr avatar Nov 16 '20 18:11 stepannassyr

@stepannassyr I can dummy-out the bli_clock() and its friends when our proposed systemless mode is selected at configure-time. However, just be aware that this means you won't be able to measure performance using any of BLIS's test infrastructure (or possibly at all).

The testsuite should still be useful for confirming correctness, though.

fgvanzee avatar Nov 16 '20 18:11 fgvanzee

@stepannassyr Please give 9bb23e6 (which is currently the head of the dev branch) a try and let me know if any tweaks are required before merging into master.

fgvanzee avatar Nov 16 '20 22:11 fgvanzee

@fgvanzee Some of the interested parties have yet to provide feedback, but so far no issues have been identified with the implementation.

stepannassyr avatar Dec 30 '20 20:12 stepannassyr

Thanks, @stepannassyr. Please keep us updated.

fgvanzee avatar Jan 04 '21 20:01 fgvanzee