-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(shortfin-sd) Usability and logging improvements. #491
Conversation
monorimet
commented
Nov 13, 2024
•
edited
Loading
edited
- Port configuration fixes
- Reduce need for topology footguns by implementing simple topology config artifacts for 4 setups (cpx:single/multi, spx:single/multi). These set server/device topologies to "known good" configurations.
- Fix example client script (send_request.py -> simple_client.py) and include in python package, arg problems fixed as well (--save)
- Remove need for source code
- Safer failures for invalid output dims
- Don't report server startup under uvicorn.error
- Updates sd README with new example CLI inputs
- Adds help for client CLI args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly small code quality improvements / questions.
@@ -38,19 +38,15 @@ def __init__(self): | |||
native_handler.setFormatter(NativeFormatter()) | |||
|
|||
# TODO: Source from env vars. | |||
logger.setLevel(logging.INFO) | |||
logger.setLevel(logging.DEBUG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For release should we move this back to info/warn? if you want I can just clean up the logging after you submit. I feel tempted to just add a debug/verbose option and pipe that through here.
} | ||
|
||
|
||
def bytes_to_img(bytes, idx=0, width=1024, height=1024, outputdir="./gen_imgs"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have this as an arg from the arg parser no need to have a second default.
|
||
def get_batched(request, arg, idx): | ||
if isinstance(request[arg], list): | ||
if len(request[arg]) == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore the index if there is only one item? Is the index -1 or something? Maybe add a comment
print(f"Error: Received {response.status} from server") | ||
raise Exception | ||
except Exception as e: | ||
print(f"Request failed: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This except clause seems redundant with the internal one. Based on docs for async with you already have a try except inside there right?
p.add_argument( | ||
"--file", | ||
type=str, | ||
default="default", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner to just check for None than a hard coded default string
parser.add_argument( | ||
"--tuning_spec", | ||
type=str, | ||
default="", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd stick to "" or None for string defaults.
from shortfin_apps.sd.components.config_struct import ModelParams | ||
|
||
this_dir = os.path.dirname(os.path.abspath(__file__)) | ||
parent = os.path.dirname(this_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you use this anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, copied from the other builder. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to be landed and iterated for testing. Address Chris's comments.
@@ -24,7 +24,7 @@ | |||
sfnp.bfloat16: "bf16", | |||
} | |||
|
|||
ARTIFACT_VERSION = "11022024" | |||
ARTIFACT_VERSION = "11132024" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can artifact version bump be automated in future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
STROBE_SHORT_DELAY = 0.1 | ||
STROBE_LONG_DELAY = 0.25 | ||
STROBE_SHORT_DELAY = 0.5 | ||
STROBE_LONG_DELAY = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this impact user experience?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the increments by which the batcher checks for incoming requests
Merging and will follow up with addressing review comments |