Skip to content

Conversation

@cmt0
Copy link
Contributor

@cmt0 cmt0 commented Jan 23, 2025

Summary:
Our Xtensa G3's toolchain, which is as recent as RJ-2024.3 release doesn't have %zu format specifier support. Since we only have the precompiled libc.a provided from cadence -- it seems from the disassembly that only the following are supported

%c: character
%s: string
%d: decimal integer
%i: decimal integer (same as %d)
%u: unsigned decimal integer
%x: hexadecimal integer
%X: uppercase hexadecimal integer
%p: pointer

which is consistent with what I've seen come-out from ET_LOG prints that pass through the vsnprintf specifier

Haven't heard of a 64-bit Xtensa DSP, so I think this 'lu' specifier mapping should work for all Xtensa toolchains regardless of vsnprintf implementation.

This diff also updates a couple of places where I most commonly see the mishandled %zu specifier. If the changes are okay, I can more widely update print statements in ExecuTorch. It would touch a lot of files, some of which would never be compiled for Xtensa.

Differential Revision: D68131252

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 23, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7895

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 1b92ed9 with merge base 71c0ad8 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 23, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68131252

@cmt0
Copy link
Contributor Author

cmt0 commented Jan 23, 2025

@pytorchbot label "topic: not user facing"

@cmt0 cmt0 force-pushed the export-D68131252 branch from 8aa5eec to 036ca20 Compare January 28, 2025 16:15
cmt0 added a commit to cmt0/executorch that referenced this pull request Jan 28, 2025
Summary:

topic: not user facing

Our Xtensa G3's toolchain, which is as recent as RJ-2024.3 release doesn't have %zu format specifier support. Since we only have the precompiled libc.a provided from cadence -- it seems from the disassembly that only the following are supported

%c: character
%s: string
%d: decimal integer
%i: decimal integer (same as %d)
%u: unsigned decimal integer
%x: hexadecimal integer
%X: uppercase hexadecimal integer
%p: pointer

which is consistent with what I've seen come-out from ET_LOG prints that pass through the vsnprintf specifier

Haven't heard of a 64-bit Xtensa DSP, so I think this 'lu' specifier mapping should work for all Xtensa toolchains regardless of vsnprintf implementation.

This diff also updates a couple of places where I most commonly see the mishandled %zu specifier. If the changes are okay, I can more widely update print statements in ExecuTorch. It would touch a lot of files, some of which would never be compiled for Xtensa.

Differential Revision: D68131252
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68131252

cmt0 added a commit to cmt0/executorch that referenced this pull request Jan 28, 2025
Summary:

topic: not user facing

Our Xtensa G3's toolchain, which is as recent as RJ-2024.3 release doesn't have %zu format specifier support. Since we only have the precompiled libc.a provided from cadence -- it seems from the disassembly that only the following are supported

%c: character
%s: string
%d: decimal integer
%i: decimal integer (same as %d)
%u: unsigned decimal integer
%x: hexadecimal integer
%X: uppercase hexadecimal integer
%p: pointer

which is consistent with what I've seen come-out from ET_LOG prints that pass through the vsnprintf specifier

Haven't heard of a 64-bit Xtensa DSP, so I think this 'lu' specifier mapping should work for all Xtensa toolchains regardless of vsnprintf implementation.

This diff also updates a couple of places where I most commonly see the mishandled %zu specifier. If the changes are okay, I can more widely update print statements in ExecuTorch. It would touch a lot of files, some of which would never be compiled for Xtensa.

Differential Revision: D68131252
@cmt0 cmt0 force-pushed the export-D68131252 branch from 036ca20 to 0ca181e Compare January 28, 2025 16:21
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68131252

Summary:

topic: not user facing

Our Xtensa G3's toolchain, which is as recent as RJ-2024.3 release doesn't have %zu format specifier support. Since we only have the precompiled libc.a provided from cadence -- it seems from the disassembly that only the following are supported

%c: character
%s: string
%d: decimal integer
%i: decimal integer (same as %d)
%u: unsigned decimal integer
%x: hexadecimal integer
%X: uppercase hexadecimal integer
%p: pointer

which is consistent with what I've seen come-out from ET_LOG prints that pass through the vsnprintf specifier

Haven't heard of a 64-bit Xtensa DSP, so I think this 'lu' specifier mapping should work for all Xtensa toolchains regardless of vsnprintf implementation.

This diff also updates a couple of places where I most commonly see the mishandled %zu specifier. If the changes are okay, I can more widely update print statements in ExecuTorch. It would touch a lot of files, some of which would never be compiled for Xtensa.

Differential Revision: D68131252
@cmt0 cmt0 force-pushed the export-D68131252 branch from 7e103f0 to 1b92ed9 Compare January 30, 2025 18:46
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68131252

@facebook-github-bot facebook-github-bot merged commit 0be650e into pytorch:main Jan 31, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported topic: not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants