This is an archive of the discontinued LLVM Phabricator instance.

[RFC][OpenMP][Doc] No backward compatible for libomptarget and plugins
ClosedPublic

Authored by tianshilei1992 on Sep 4 2022, 12:14 PM.

Details

Summary

Now we state that backward compatibility is not guaranteed in the document.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Sep 4 2022, 12:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2022, 12:14 PM
tianshilei1992 requested review of this revision.Sep 4 2022, 12:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2022, 12:14 PM

I'm not sure they were ever backwards compatible. We definitely didn't test mixing pieces across releases. Perhaps we should phrase it as "they are not backwards compatible", dropping the "no longer" part?

I'm not sure they were ever backwards compatible. We definitely didn't test mixing pieces across releases. Perhaps we should phrase it as "they are not backwards compatible", dropping the "no longer" part?

I think in the past we were trying to make it backward compatible. For example, we keep all existing interfaces unchanged, and their behaviors unchanged. Also we only add new interfaces and never remove old ones. However, as you said, we didn't promise it, and didn't test that either. I can remove it from the description.

tianshilei1992 edited the summary of this revision. (Show Details)Sep 4 2022, 7:00 PM
tianshilei1992 retitled this revision from [RFC][OpenMP][Doc] No more backward compatible to [RFC][OpenMP][Doc] No backward compatible for libomptarget and plugins.
JonChesterfield accepted this revision.Sep 4 2022, 7:09 PM

LG, thanks!

This revision is now accepted and ready to land.Sep 4 2022, 7:09 PM

This is emergent from being based on LLVM which isn't compatible between versions I'm assuming. We should probably discuss this at the multi-company meeting as it would have some other ramifications. For example, we wouldn't need to keep the legacy interfaces, and having version fields wouldn't be necessary as we can strictly control the version without an installation.

This is emergent from being based on LLVM which isn't compatible between versions I'm assuming. We should probably discuss this at the multi-company meeting as it would have some other ramifications. For example, we wouldn't need to keep the legacy interfaces, and having version fields wouldn't be necessary as we can strictly control the version without an installation.

Yes, I already put the two patches at the top of the discussion doc.

dreachem added inline comments.
openmp/docs/SupportAndFAQ.rst
340
dreachem added a comment.EditedSep 7 2022, 10:12 AM

@tianshilei1992 Can you explain a bit more what is the motivation here? Does requiring a new entry point rather than changing the interface for a pre-existing entry point create problems? The Cray compiler doesn't use libomptarget, but it does use the interface. It is also designed to support interoperability with other LLVM-based compilers, which may be based on a newer version of LLVM. Backwards compatibility with the libomptarget interface is needed for that to work (not necessary for the plugins).

@tianshilei1992 Can you explain a bit more what is the motivation here? Does requiring a new entry point rather than changing the interface for a pre-existing entry point create problems? The Cray compiler doesn't use libomptarget, but it does use the interface. It is also designed to support interoperability with other LLVM-based compilers, which may be based on a newer version of LLVM. Backwards compatibility with the libomptarget interface is needed for that to work (not necessary for the plugins).

Currently we attempt to maintain backwards compatibility with old programs being run with a new libomptarget build. We do this by keeping around the legacy function interfaces, even if they are slower now. This was never an explicitly stated goal guarantee , but it has some benefits for users on clusters switching versions of LLVM without needing to recompile. Now that we have made libomptarget and the plugins an LLVM library we use versioned libraries, e.g. libomptarget.so is a symbolic link to libomptarget.so.16. LLVM isn't backwards compatible between versions, so if users require an older version they can stick with the versioned library that they require. The argument is that we should do the same with libomptarget as this would allow us to make useful changes to the binary and remove some legacy interfaces. We could keep the old entries into libomptarget, but there are some we'd like to change. For example, I would like to remove the omp.register_requires function and replace it with a new interface. This would be a breaking change if we expect backward compatibility as the old function would either not exist or be a no-op. I would like the ability to make changes like this, I'm not exactly sure what CUDA's backwards compatibility method is between CUDA releases, we may be able to compare policies for what users expect.

@tianshilei1992 Can you explain a bit more what is the motivation here? Does requiring a new entry point rather than changing the interface for a pre-existing entry point create problems? The Cray compiler doesn't use libomptarget, but it does use the interface. It is also designed to support interoperability with other LLVM-based compilers, which may be based on a newer version of LLVM. Backwards compatibility with the libomptarget interface is needed for that to work (not necessary for the plugins).

Like @jhuber6 mentioned, the libraries are not backward compatible any more, thus there are pointless to maintain the interfaces compatibility. It will be more convenient and more efficient.

However, I got your point. You still hope applications generated by Cray compiler can be executed with upstream libomptarget. That is a good design. Does it make sense for Cray to just support the interoperability with specific version of libomptarget? For example, say CCE x.y.z is compatible with libomptarget.so.16, and CCE k.m.n is compatibly with libomptarget.so.17, and so on. That will require Cray compiler to follow the interface changes in upstream. After all, libomptarget never claims to be backward compatibility and API stable. In the past we just "tried" to maintain it, but in fact never tested that. IIRC, we never expect users to used the mixed versions of libraries.

tianshilei1992 marked an inline comment as done.Sep 20 2022, 9:03 PM
openmp/docs/SupportAndFAQ.rst
341–342

I don't think we should say this. We don't say what user can do, we already say they should not mix libraries and compiler.

dreachem requested changes to this revision.Sep 23 2022, 1:29 PM
dreachem added inline comments.
openmp/docs/SupportAndFAQ.rst
338–342
This revision now requires changes to proceed.Sep 23 2022, 1:29 PM
tianshilei1992 marked 2 inline comments as done.Oct 5 2022, 5:49 AM

@dreachem Does it look good to you now?

dreachem accepted this revision.Nov 2 2022, 7:43 AM

Looks good.

This revision is now accepted and ready to land.Nov 2 2022, 7:43 AM