This is an archive of the discontinued LLVM Phabricator instance.

[mlgo] Make InteractiveModelRunner actually work with named pipes
ClosedPublic

Authored by mtrofin on Feb 1 2023, 2:04 PM.

Details

Summary

Turns out raw_fd_stream doesn't work with named pipes, so we just need
to lower the abstraction. Updated the unittest accordingly. Because
mkfifo's path argument requires a certain naming pattern on Windows
(IIUC), restricted the test to Linux only.

Diff Detail

Event Timeline

mtrofin created this revision.Feb 1 2023, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 2:04 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mtrofin requested review of this revision.Feb 1 2023, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 2:04 PM
kazu accepted this revision.Feb 1 2023, 2:57 PM

LGTM. Just minor comments about sticking to the FileSystem.h API and removing a couple of #includes.

llvm/include/llvm/Analysis/InteractiveModelRunner.h
19

If you are lowering things down to sys::fs::file_t, you probably don't need this!?

llvm/lib/Analysis/InteractiveModelRunner.cpp
18

You should be able to remove this if you can switch ::read to sys::fs::readNativeFile below.

76

Can you use sys::fs::readNativeFile for consistency with sys::fs::openFileForRead and sys::fs::closeFile?

llvm/unittests/Analysis/MLModelRunnerTest.cpp
179

Likewise, can you use sys::fs::readNativeFile for consistency with sys::fs::openFileForRead?

202–203

Likewise.

214–215

Likewise.

238–239

Likewise.

249

Can you use sys::fs::closeFile here?

This revision is now accepted and ready to land.Feb 1 2023, 2:57 PM
mtrofin updated this revision to Diff 494081.Feb 1 2023, 3:14 PM
mtrofin marked 8 inline comments as done.

feedback

(addressed feedback)

This revision was landed with ongoing or failed builds.Feb 1 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.
hctim added a subscriber: hctim.Feb 1 2023, 4:12 PM

Hey, looks like this might've broken the windows sanitizer bots. Would you be able to take a look? https://lab.llvm.org/buildbot/#/builders/127/builds/43077

Thanks.

Hey, looks like this might've broken the windows sanitizer bots. Would you be able to take a look? https://lab.llvm.org/buildbot/#/builders/127/builds/43077

Thanks.

Yup, looking.