pytorch / pytorch/executorch

Xtensa platform does not support pread()

Open
#4,812 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

module: cadence triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

We have to use a worakround in the FileDataLoader for Xtensa platform to support read the file at different offsets on multiple threads simultaneously. Seeking to different locations on the same file descriptor is a mutating operation, so normally we use pread() call that doesn't affect the current file offset and leaves the file descriptor intact. There's no such call available on Xtensa atm, so we open the file again to obtain a new file descriptor and seek on it without affecting the original or the ones opened by other threads.

Versions

Current version

cc @mcremon-meta

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the FileDataLoader workaround and the Xtensa platform file APIs, then determine how pread() support is provided on that platform. Done means concurrent reads at different offsets no longer require reopening the file.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.